Object-Oriented Programming is Garbage: 3800 SLOC example
Channel:Brian Will · Length:52:48 · Published:2016-03-22 · Views:258449
Summary
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.
Why HN recommends it
HN recommends it as a concrete, worked example of the case against heavy OOP rather than abstract argument.
I recommend the whole series — HN, 2022
Software architecture & design · Software practice, open source & careers
Subtitles (excerpt)
I'm escalating once again and this time object-oriented programming is garbage and we'll be looking at an example that's about 3,800 significant lines of code it's this original NES emulator I found on GitHub it's implemented in goang and I picked it partly because it's just interesting to look at a working NES emulator that's relatively short it's nice and compact for being a working emulator but I also picked it because it's actually a very moderate example of objectoriented programming gone wrong it doesn't really commit any absurdities like examples in the last video and actually on a line by line basis the code is quite good it's just structurally it's written in what I would call an obligatory objectoriented style it's written in an oo way for the sake of being oo not to any real purpose so credit to the Project's author Michael fogman it's it's a cool project and the code is actually just fine except for its oess and I wanted to demonstrate how it would be better in a straight procedural style now I'm not going to give a full account of the emulator works because actually honestly the details I'm sketching on myself because I don't understand the details of the NES Hardware if you want to learn
On Hacker News
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] — codemonkey-zeta, 2022-06
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] — lj3, 2016-12
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 abou… — barking, 2017-06
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 cod… — hasenj, 2017-04
Related videos
- Mock Interview with Shawn McGrath · Molly Rocket · 1:41:38
- Why Adults Can't Develop Perfect Pitch · Rick Beato · 16:26
- RailsConf 2014 - All the Little Things by Sandi Metz · Confreaks · 38:47
- "Simple Made Easy" - Rich Hickey (2011) · Strange Loop Conference · 1:01:38
- "Making Impossible States Impossible" by Richard Feldman · elm-conf · 25:06
- 🚀 TDD, Where Did It All Go Wrong (Ian Cooper) · DevTernity Conference · 1:03:55
- How To Design A Good API and Why it Matters · Google TechTalks · 1:00:19
- The Value of Values with Rich Hickey · InfoQ · 31:43
- Bret Victor The Future of Programming · Joey Reid · 32:55
- Overwatch Gameplay Architecture and Netcode · GDC Festival of Gaming · 1:04:03
- Solving Problems the Clojure Way - Rafal Dittwald · Clojure/north · 1:02:26
- Lecture 1A: Overview and Introduction to Lisp · MIT OpenCourseWare · 1:12:55
- Alan Kay - Normal Considered Harmful · powerfuloutlet · 1:07:26
- A Philosophy of Software Design | John Ousterhout | Talks at Google · Talks at Google · 1:01:40
- "Uncle" Bob Martin - "The Future of Programming" · Paul Stringer's Mobile Tech · 1:18:21
- Effective Programs - 10 Years of Clojure - Rich Hickey · ClojureTV · 1:14:51