Stop Writing Classes
Next Day VideoYouTube ↗
Further reading 1
Caption notes
At PyCon US 2012, Jack Diederich uses a greeting object to show how he decides whether a Python class earns its place. If initialization only saves an argument and the object is created for a single method call, he considers using a function for the job. He gives a heap as a counterexample: a class can group several operations around the same mutable data. In the Q&A, an audience member points out that library callers may need to inspect a stored argument. Diederich acknowledges that simplification can go too far.
Archived captions (transcription method unspecified) ↗Original passages · 2
you should have just written a functiona bundle of mutable data and a bunch of related functions