Skip to content
0:00 / 0:00

#python#oop#refactoring

Stop Writing Classes

Next Day Video

68K subscribers • 16 videos on Hallway

YouTube
  • Recommended by 8 people: 8 on Hacker News.
  • A classic. People kept recommending it from 2012 to 2025.
  • Presented by Jack Diederich
  • An opinion. It argues one side of a question engineers disagree on.

Intermediate. Assumes working knowledge.

961K views14 years ago8 recommendations

Programming languagesSoftware designPythonDesign patternsRefactoring and legacy code

Jack Diederich argues that classes are overused in Python and demonstrates how to refactor unnecessary classes, exceptions, and modules into simpler functions.

Jack Diederich Classes are great but they are also overused. This talk will describe examples of class overuse taken from real world code and refactor the unnecessary classes, exceptions, and modules out of them.

Why it's here

8 people recommend this

What people say. Recommended as a classic talk on Pythonic simplicity and avoiding over-engineered object-oriented designs.

inglespon Hacker News • Recommends

On “An Object is not a Hash”

I think you're thinking of Jack Diederich's talk "Stop Writing Classes". You can (and should!) watch it online here: link to this video

Vaskivoon Hacker News • Recommends

On “Ask HN: What do you think about using classes in Python?”

Stop writing classes - Jack Diederich - link to this 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 discovered the solution, Entity Component Architectures1, I also discovered the "composition over inheritance" philosophy. My mind was blown! Coupled with some Python's characteristics (duck-typing, everything is public, first-class functions) I was having a blast. Then I saw the video above, and al…

kyleperikon Hacker News • Recommends

On “Ask HN: What is your favourite tech talk?”

Stop writing classes is one of my favorites. Also many pycon talks are great, or any talks by Brandon Rhodes. link to this video

michelppon Hacker News • Recommends

On “I Don't Use Classes”

I also tend to avoid writing many classes (in Python). Jack Diederich has a great video called Stop Writing Classes: link to this 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."

gingerlimeon Hacker News • Recommends

On “Ask HN: What's the best technical talk you've heard?”

Hickey gives great talks, but I also really liked Jack Diederich's talk "stop writing classes" at PyCon 2012 link to this video

jmielkewayon Hacker News • Recommends

On “Ask HN: What has improved You as a Developer?”

I read this book: link While doing these labs: link Also a colleague made me watch this from Jack Diederich: link to this video

1penny42centson Hacker News • Recommends

On ““What if it changes?””

Reminds me of this talk, "Stop Writing Classes": link to this video Changed my perspective on this newfound tool I'd learned to use called "indirection". My favorite quote is something like "don't waste 10 minutes now to save yourself 2 minutes later".

zahlmanon Hacker News • Recommends

On “Why Is Python So Popular in 2025?”

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, link to this video .

u/Faucelmein r/haskell • Mentions

On “Writing Simple Haskell”

> It's hard to shift away from that Python mindset of wanting to make a class straight away etc. Without leaving Python, this "Stop Writing Classes" video makes some good points link to this video

u/crdrostin r/haskell • Mentions

On “Monthly Hask Anything (December 2019)”

(a) Get yourself some sum types in any language. If it has to be a C struct with a byte that you switch() over and several nullable pointers to other structs, so be it. Similarly tricky in a database. (b) Avoid mutation-heavy algorithms. Global mutable state should live in a central place. (c) Stop writing classes. (d) Steal a lot of ideas from smart people like category theorists when you can. Especially think about things like neutral/identity elements, and occasionally the difference between a Monday and an applicative; sometimes you can prove that something is impossible without kludges before you start it, and then you can give more attention and a central place to the kludges. (e…

krosaenon Hacker News • Mentions

On “The IDE as a value”

…ual arguments and return values of these end points are really better thought of as values - and the expected structure of these values can certainly be part of the API. You just don't force people to construct and destruct objects for everything you are passing around. A couple of related resources on this topic: "Stop writing classes" from PyCon link to this video Rob Pike's reflection on using data vs OO: link…

simon_weberon Hacker News • Mentions

On “Why Ruby Class Methods Resist Refactoring”

"The signature of 'this shouldn't be a class' is that it has two methods, one of which is __init__." 0 Why not write a function? This addresses all of the objections. Then refactor by pulling out concerns into other functions. Need to share logic around the functions? Use a decorator. Passing too many attributes? Create a class to contain them. I think classes are best avoided until it's obvious that encapsulating state provides a benefit, which I don't see in this case. 0 link to this video

youwishboyeon Hacker News • Mentions

On “Ask HN: What made you change your mind about a programming language/paradigm?”

Growing a Python codebase like you would a Java/C# one (i.e. with tons of classes, interfaces, factories etc.) is a sure way to pull your hair out. However, Python provides a bit of metaprogramming that could drastically reduce the number of LOC needed, should you write it in a Pythonic way. That is, experienced Python programmers could write concise and performant Python code in less or at worst equal time as experienced Java/C# programmers. But if you hire Java/C# devs to write Python code, I can see how you could arrive at your conclusion. Bonus video: link to this video

Psyladineon Hacker News • Mentions

On “Old CSS, New CSS”

>That assumes that all of this complexity was done for complexity’s sake. Or they just don't know any better. link to this video

makapufon Hacker News • Mentions

On “The use of `class` for things that should be simple free functions”

Also known in python as "if your class has only two methods, one of which is init, it's a function" in the "stop writing classes" link to this video EDIT: typo, changed link

el_onion Hacker News • Mentions

On “You've only added two lines – why did that take two days?”

It reminds me of a pycon talk 0 which, while i dont agree with the whole thing, has the message "we ship features, not code". That also reminds me of "when a measure becomes a target, it ceases to be a good measure". LOC is a decent measure, but features are our targets 0 link to this video