Stop Writing Classes

Channel:Next Day Video · Length:27:29 · Published:2012-03-15 · Views:962068

Watch on YouTube

Summary

Jack Diederich's PyCon 2012 talk argues that classes are overused in Python and walks through real code, refactoring away unnecessary classes, exceptions and modules. It popularized the heuristic that a class with two methods, one being __init__, should be a function.

Why HN recommends it

HN returns to it repeatedly as the canonical argument for simplicity and against premature abstraction, and several commenters say it changed how they write code.

Jack Diederich has a great video called Stop Writing Classes: It's about Python, but the observation can apply to several languages. — HN, 2020

Python, Ruby & scripting languages · Software architecture & design

Subtitles (excerpt)

introduce Jack drick uh a core developer uh who's going to talk to us about how to stop writing classes Jack [Applause] drick I don't mean to disappoint but I'm actually going to agree with everything Raymond just said wrestling so you've all read the zenap python probably many times um couple items simple is better than complex FL is better than nested readability counts if the implementation is hard to explain it's a bad idea if the implementation is easy to explain it may be a good idea um this is written by Tim Peters um he's smarter than you are he's smarter than I am uh how many people do you know with a sorting algorithm named after them that's the guy who wrote this and all of these points say don't do hard things do easy things and that's what this talk about is about so don't do hard things in the first place when you can avoid it um classes as Raymond knows well are can be very complicated he laid out some principles uh how you should figure out what you shouldn't be doing uh this talk is mostly about all the places where people go wrong and how you can just not do that at all um you end up doing that anyway even when you're trying to avoid it so this talk is actually going to be be uh rehashing some code uh how to notice when you've gone down the

On Hacker News

I also tend to avoid writing many classes (in Python). Jack Diederich has a great video called Stop Writing Classes: [VIDEO] It's about Python, but the observation can apply to several languages. Pithy quote: "I hate code and I want as little of it as possible in our product." — michelpp, 2020-03
Stop writing classes is one of my favorites. Also many pycon talks are great, or any talks by Brandon Rhodes. [VIDEO] — kyleperik, 2018-04
Stop writing classes - Jack Diederich - [VIDEO] Show them this. I'm still grateful for the moment I grew dissatisfied with OOP, or at least OOP in the Java/C# way. I was almost getting to an intermediate level in python (by myself) and had been thinking about a video game architecture problem I just couldn't solve. I was still "indoctrinated" in the gang-of-four patterns and inheritance. When I d… — Vaskivo, 2014-12
I think you're thinking of Jack Diederich's talk "Stop Writing Classes". You can (and should!) watch it online here: [VIDEO] — inglesp, 2012-10
Yes, the standard library has a lot of questionable design (some inspired by Java, some by C), and many programmers overuse classes. I'm a fan of (former core dev) Jack Diederich's talk, [VIDEO] . — zahlman, 2025-10

Related videos