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!
Just because a programming pattern or convention becomes popular doesn’t always mean that it’s a good idea. This talk digs into the consensus that the Python community has built around what constitutes “Pythonic” code, with a focus on cases where the conventional wisdom may be wrong. I knew that many audience members at code::dive would be programmers in compiled languages like C++, so the talk is designed to introduce the features of a dynamic language and the same time as it discusses how code in such a language can become more readable and more effective.
The ancient Greeks hypothesized that the southern hemisphere had a temperate zone matching that of the northern hemisphere, where there existed a separate human race standing upside down compared to ourselves. I celebrate my first visit to Australia by considering several ways in which I find myself upside down, both when crafting personal communications, and also public texts such as tweets.
What would an algorithm look like that improves on the TeX typesetting system’s scheme for breaking a book’s text into pages? This talk explores a new Python library for high quality typesetting that I have been crafting, and that I have already used to format and print a short-run hardback book!
How much does the quality of our tools influence the problems we solve? I look at several examples of how good tools can lower the “activation energy” necessary to make a problem worth tackling. After looking at several examples of how a novel tool has transformed my habits, I look at how Python's simplicity let me help a beginning programmer solve some questions we had about an upcoming Grand Canyon hike!
The Python language’s memory model can be deduced from first principles: simply take modern C++ conventions and drive their safety and generality to infinity. But this limiting case generates its own compromises and opens its own categories of possible runtime errors. This talk explores the position Python has staked out in the language design space of correctness versus performance, the choices Python programmers make when they need to move closer to C++, and the ways that the C++ community keeps adopting conventions that look suspiciously like Python.
My Skyfield astronomy library generates planet and satellite positions for Python programmers. How can a library that accepts a time argument and returns a position be used the other way around: to search for the time and date that a particular circumstance occurs? Using several techniques to search for rising and setting times, I was able to schedule a final glimpse of the space station Tiangong-1 hours before it burned up in our planet’s atmosphere!
I got several questions after my PyCon 2017 talk about how I had programmed its ASCII-art animations. But I didn’t wind up releasing the underlying animation library — it was simply too horrible! In this exposé I describe how my library worked, explain where the design went wrong, and reveal an improved design which I have now open-sourced from the ashes of the original.
Where can computer programming be placed on the more general landscape of problem solving? In this keynote, I explore that landscape, describe where computer programming is usually located on the landscape, and suggest practices for the programmer who wants to become a more effective problem solver.
Since my “Mighty Dictionary” talk at PyCon 2010, the Python dictionary has evolved dramatically. This talk discusses iterable views, the dictionary’s dedicated comprehension syntax, random key ordering, the special key-sharing dictionary designed to underlie object collections, and, most famously of all, the new “compact dictionary” that cuts dictionary storage substantially — and carries a fascinating side-effect.
How can Python use Selenium to take command of a web browser and step it through thousands of tests that have to run hundreds of times per day? What anti-patterns emerge when an organization has been maintaining a Selenium test suite for multiple years? At Dropbox, I and my co-workers use Python to deliver test results to hundreds of other engineers. Come learn the lessons we have learned so far!
What does the landscape of Python web frameworks look like out beyond the world of Plone and Zope? Will Python continue to be a popular language for web development? I share some thoughts about where the community’s efforts to address the web have gone and where they might go in the future.
In 1991 the newly-released Python language sallied forth into a profession already riven with rivalry between competing technical traditions. Learn about the stand that Python took on one side of a long-running argument, about the technology ideas it shares with UNIX, and about the important lessons from computing history that Python today delivers to programmers around the world.
2016 February 20
PyCaribbean • Santo Domingo
The LIGO team that just announced the detection of a gravity wave used Python for some of their data reduction and plotting. How has this little language, released on the Internet in 1991 as a mash-up of good features from other languages, grown into a world-class tool — and why is its rate of adoption higher today than ever before?
The duties of organizing PyCon has prevented me from completing my new testing framework, so instead I am going ahead and sharing all of its good ideas in the hope that other testing frameworks will adopt them and I will get to enjoy them regardless of the framework I use! Thoughts on making a testing framework fast, reactive, and Pythonic.
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?
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.
Update: In response to this old talk’s popularity, I have started a site where I accumulate essays on different design patterns in Python — enjoy!
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