Introduction
To err is human; to really foul things up requires a computer.
Bill Vaughan
I started programming with Python in 2000, at the very tail end of The Bubble. In that time, I’ve…done things. Things I’m not proud of. Some of them simple, some of them profound, all with good intentions. Mistakes, as they say, have been made. Some have been costly, many of them embarrassing. By talking about them, by investigating them, by peeling them back layer by layer, I hope to save you some of the toe-stubbing and face-palming that I’ve caused myself.
As I’ve reflected on the kinds of errors I’ve made as a Python programmer, I’ve observed that they fall more or less into the categories that are presented here:
- Setup
-
How an incautiously prepared environment has hampered me.
- Silly things
-
The trivial mistakes that waste a disproportionate amount of my energy.
- Style
-
Poor stylistic decisions that impede readability.
- Structure
-
Assembling code in ways that make change more difficult.
- Surprises
-
Those sudden shocking mysteries that only time can turn from OMG to LOL.
There are a couple of quick things that should be addressed before we get started.
First, this work does not aim to be an exhaustive reference on potential programming pitfalls—it would have to be much, much longer, and would probably never be complete—but strives instead to be a meaningful tour of the “greatest hits” of my sins.
My experiences are largely based on working with real-world but closed-source code; though ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access