A conference lasts only a few days. But when organizers are able to record the talks and keynotes, the event can impact hundreds more people who were not able to attend. Here are some of my own efforts to get up on stage and share what I have learned with the communities that have given me so much!
2015 May 26
PyWaw • Warsaw
Skilled workers traditionally build time into their schedule to stop and sharpen their tools. But programmers, working under tight deadlines, often avoid stopping to automate a repetitious process, or to reconfigure an awkward setting in their editor — and, as a result, can waste hours fighting their tools. What kinds of tools should a programmer take the time to surround themselves with for the greatest productivity?
2015 May 25
PyWaw • Warsaw
Our programs too often leave control decisions stranded in low-level routines, producing tightly coupled systems that make it difficult to re-use code. What are the warning signs of tightly coupled I/O and how can it be corrected? Particular attention will be paid to the way that modern Python syntax supports a broader array of solutions than were once possible!
Python string operations are profligate in their use of memory — the steps necessary to parse an HTTP request often make four or five copies of every incoming byte. But does it matter? This talk explores the “bytearray,” outlines how its proper use dramatically reduces copying, but finds that it can only improve the performance of a few specific I/O operations.
2014 October 12
PyCon Ireland • Dublin
(Slides coming soon)
Ancient scientists did not wait around for Python to be invented, but went ahead and built a model of the universe using more primitive means of calculation. But today we can finally bring their work up to date! By applying data analysis and in-browser visualization to the best and most accurate modern astronomical data, we will rebuild the ancient and medieval model of the universe — from the orbit of the Moon all the way up to the highest heaven. In the process we will see how vector math, statistical solvers, plotting libraries, and animation can all be brought together inside of the IPython Notebook.
At its essence, a web framework like Django is designed to duct tape over awkward problems with data. Problems like the fact that data wants to live on big servers, but users keep wanting it to appear on their screens instead. And that users want to edit data, but are horrible typists. Now that data is becoming big business for Python, how do web frameworks fit into the picture — and is Django up to the challenge?
While Tolkien had friends who could devise ingenious ways to critique his work without sounding critical, he had others whose remarks were merciless and direct — to the point that Tolkien simply stopped sharing new chapters as he wrote The Lord of the Rings. As programmers we endure many of the struggles of writers and artists, and often react just as badly to critique of our code. From Tolkien’s experience we will draw lessons about how to make critique generous instead of damaging, and actionable instead of personal.
2013 October 13
PyCon Ireland • Dublin
Python programmers already use many design patterns in their work. Each pattern distills the wisdom the community has learned over the years, often at great expense, and makes it available to younger programmers. But even design-conscious programmers often find their applications growing more difficult to test and expand. In this talk, we will learn about how the recently propounded “Clean Architecture” applies to Python applications, and how this high-level design pattern fits particularly well with the features of the Python language.
Modern operating systems sandbox each process inside of a virtual memory map from which direct I/O operations are generally impossible. Instead, a process has to ask the operating system every time it wants to modify a file or communicate bytes over the network. By using operating system specific tools to watch the system calls a Python script is making — using “strace” under Linux or “truss” under Mac OS X — you can study how a program is behaving and address several different kinds of bugs.
It was once quite painful to build your Python app as a single .exe file. Support forums filled with lamentations as users struggled with primitive tools. But today, two separate tools exist for compiling your Python to real machine language! Come learn about how one of the biggest problems in commercial and enterprise software has now been solved and how you can benefit from this achievement.
Why are Python programmers crazy about lists and dictionaries, when other languages tout bitmaps, linked lists, and B+ trees? Are we missing out? Come learn how data structures are implemented on bare metal, how to select the right data structure, how the list and dictionary cover a wide swath of use cases, and when to dip into the Standard Library for an alternative.
For programmers, perhaps the most annoying thing about our prejudices is the rate at which they go out of date. Your reasons for choosing your operating system, editor, version-control system, and web framework were — of course — perfect and provable at the time that you made your choice, and anyone who disagreed with you was an obvious nitwit. But what happens when the competing editor suddenly improves? When that blocker in the rival database is removed? The choice between Python web frameworks is the same way. We will look at how Django has recently been improving by leaps and bounds, invalidating old prejudices against it with every recent release.
I released the first version of PyEphem in 1998. Built with SWIG, it made astronomical calculations in Python only slightly more convenient than writing them directly in C. A rewrite five years later improved the interface, but a decade of fielding user questions has convinced me to re-think how an API should help programmers cope with an unfamiliar and complex domain like astronomy. This talk will explore how API design, NumPy integration, and modern high-performance Python computation combine in Skyfield, the new pure-Python astronomy library that I will release during the PyCon Canada sprints!
What are the key features of a modern dynamic language like Python that let a programmer make progress even against difficult problems, even on days when things are not going well? Starting simple and then ramping up to complex, Brandon takes us from how beginners can use a Python dictionary to pair up matching data, to how to use ctypes to work around limitations in the built-in Python SSL module, as he takes us through the tools and approaches that for a Python programmer are all part of a day's work — the features without which we would not be as productive.
Warsaw was the perfect venue for reflecting on how Mikołaj Kopernik — the Polish astronomer who published in Latin as “Copernicus” — faced the perennial problem of refactoring, when he saw redundant code repeated all through Ptolemy's model of the solar system.
Continuing where my PyCon Canada talk left off, I explore several common practices for choosing names wisely when writing Python code — and suggest that apt names are the lifeline that keep programmers afloat in dynamic languages.
To introduce the wonderful conveniences of scientific Python to the crowd at CodeMash, where the majority platforms are Ruby, .NET, and Java, I showed how the IPython Notebook can be combined with basic astronomy libraries to create tools with which to explore the Solar System.
This was my very first experience with being an invited speaker, where I could choose any topic I wanted instead of having to submit a competitive proposal. I wanted to use this opportunity by filling the talk with the kind of miscellaneous, practical coding advice that so rarely fits the agenda of a more serious proposal. Instead, one single topic wound up filling the whole time slot: how we format and indent Python code as a personal and intentional act of graphic design.
I had recently seen a talk that dismissed the idea that Python programming involves design patterns, and I realized that I disagreed: there are all kinds of patterns emerging in the Python community, as well as widespread use of many of the classic patterns. As a first step towards the topic (hence the “1” in the talk title — it is, hopefully, the first of several talks on the subject), I look at the continuing popularity of many of the classic Gang of Four patterns even in modern Python programming.
Too often, programmers use ORMs to hide from their database and avoid learning how it works. Instead, I encourage programmers to learn a bit of SQL and become familiar with the problems that database queries are designed to solve well. In this talk, I outline the basics of using SQLAlchemy to craft efficient queries and avoid several common database query anti-patterns.
Another whirlwind technical introduction in the style of my previous talk on Python dictionaries. This time, I tackle how modern operating systems allocate and manage memory by using a simple example memory image that intends to capture all of the essential moving parts while being as simple in its details as possible.
2011 September 24
PyCon Poland • Mąchocice, Poland
Fred Brooks said famously that our data structures are the most important thing about our computer programs, yet a generation of programmers is trying to use ORMs to avoid learning how SQL really structures their data. This talk is a basic plea for programmers to jump in and really understand their data store, whether it is a relational database, a key-value store, or something else.
Object-orientation is a troubled programming approach that, because of its popularity in the 1990s, wound up afflicting great swaths of the Python Standard Library. By looking at specific examples in several popular web-related modules, we will see the problems that are created when an API author tries to invite you inside of their classes to become a co-developer with them.
For the educators among us, I suggest a visceral metaphor by which newer programmers might be able to understand and predict the moment at which an object or data structure will be freed from Python's memory.
Objects in a dynamic language can be slippery: merely accessing an attribute can make it appear, disappear, or even change value, at the whim of whatever overly clever programmer designed the object you are accessing. This talk looks at strategies and technologies for getting behind shifting dynamic behaviors to see the properties of an object without the risk of affecting its state.
An account on a shared Unix machine is usually a dicey platform on which to deploy a Python web app, but Webfaction uses interesting approaches to keep users fairly well sandboxed. So I gave a PyCon talk on their techniques, which could be applied on one's own systems to help keep apps separate. Of course, boxes have become cheap enough in the intervening few years that most people now spin up a separate machine per web application without even having to think about it!
For most Python programmers, the behaviors of the dictionary data type are simply memorized: instant access by key, keys must be immutable, and order is arbitrary and shifting. But what technology is behind these bizarre features? This talk goes behind the scenes with bright, colorful, simple diagrams to show exactly how Python's most popular data structure works.
Web development often involves bringing together many different components to build a single site. Authentication, social networking, media management, and content management are examples of the kind of features that are often powered by third-party modules or extensions. This talk introduces Zope's adapter registry and how a declarative web framework like Grok lets you use the “Adapter” gang-of-four design pattern to link components together into a cleanly functioning site. To extract and run the example in messagetree.tar.gz, type:
tar xzf messagetree.tar.gz cd messagetree python bootstrap.py bin/buildout bin/run