Jack Diederich: Stop Writing Classes

Python is famous for making it easy to get into programming: The syntax is simple, the constructs readable, and the data structures rich. Python also makes it easy to create new classes and work with objects.

In some ways, though, Python makes it too easy to create and work with objects. Python, unlike some other programming languages, doesn’t require that you use classes, but makes that possible. This means that developers wills sometimes create new classes when it is unnecessary — when functions and Python’s built-in data structures more than suffice.

In this talk, Python core committer Jack Diederich describes and demonstrates many cases in which Python developers went overboard, creating and using classes when there was no good reason to do so.  Using classes made the resulting code slower and more complex than as otherwise necessary.

Leave a Reply