Object-Oriented Programming is Garbage: 3800 SLOC example
Brian Will2 HN recommenders · 2016–2022
258K views · lecture · evergreen · Uploaded 2016-03-22
Brian Will critiques object-oriented programming and rewrites a roughly 3800-line OO program in a procedural style, cutting code and complexity. It is part of a series of OOP critiques.
HN recommends it as a concrete, worked example of the case against heavy OOP rather than abstract argument.
38:47RailsConf 2014 - All the Little Things by Sandi Metz
Confreaks
1:01:39"Simple Made Easy" - Rich Hickey (2011)
Strange Loop Conference
25:06"Making Impossible States Impossible" by Richard Feldman
elm-conf
1:03:55🚀 TDD, Where Did It All Go Wrong (Ian Cooper)
DevTernity Conference
1:00:19How To Design A Good API and Why it Matters
Google TechTalks
31:44The Value of Values with Rich Hickey
InfoQ
32:56Bret Victor The Future of Programming
Joey Reid
1:04:04Overwatch Gameplay Architecture and Netcode
GDC Festival of Gaming
4 comments from Hacker News
There are three talks, actually. Here are the other two. Object-Oriented Programming is Embarrassing: 4 Short Examples[0] Object-Oriented Programming is Garbage: 3800 SLOC example[1] [0]: [LINK] [1]: [VIDEO]
This kind of thinking bothers me, but I'm not sure how to put my finger on what exactly it is that bothers me, or how to put it into words. The thing with these abstract architecture principles is they are not always practical if you try to be puristic about enforcing them. I get where these ideals come from. I've seen novice programmers take a stab at writing mildly complicated apps, and the code is a nightmare to read because everything is jumbled up together. This is bad and we can all agree on that. But I've also seen projects where everything is split into a tiny little function or object that don't seem to be doing anything meaningful. Presumably these projects are following the principles of "single responsibility" and "loose coupling", but it's so loose that it's hard to put the pieces together in your mind and nearly impossible to follow the flow of the program. I consider generic rules of the form: "<X> related objects should not be doing <Y> related stuff" to be harmful. (An example of such "bad rules" can be found in the article under the heading "Use Cases") Instead I prefer practical rules that make the code easy to read, understand, and updated, without making it any more complicated that it needs to be. * If a piece of logic can be contained in a function, let it be contained in one function without splitting it across 10 different objects and factories and coordinators. Even if that function is slightly long, there's no need to split it apart just because it'
Brian Will, the guy behind the 'why OOP is bad' youtube video brings this into his argument. In a follow up video to that video he rewrites an OO program in procedural style. In doing so he reduced the number of methods/functions from 321 to 113, 54 of which were contained inside other functions as they were only accessed by the containing function. The total number of lines of code remained about the same. That's over 200 fewer meaningful names to try to come up with in a short program. Plus the fact that functions that do bigger tasks are easier to name in the first place, imo. [VIDEO]
For anyone unfamiliar, I recommend the whole series, but it also culminates in the presenter rewriting an entire nontrivial OOP program into a procedural one and saving whopping amounts of code/complexity. The big example helps to show this isn't just abstract rambling against OOP. [VIDEO]