5 ms·
At the risk of putting readers off by the title, there's a video essay on YouTube called "Object-Oriented Programming is Bad"[1]. It's both thoughtful and thou
by cxr 6y ago
At the risk of putting readers off by the title, there's a video essay on YouTube called "Object-Oriented Programming is Bad"[1]. It's both thoughtful and thought-provoking, although I don't agree with the conclusion. Steve Naroff (from Stepstone/NeXT/Apple) did a recent-ish set of interviews with the Computer History Museum[2][3] and referenced that video a bit (and extemporized about objects in small parts throughout). Side note: Naroff and Brad Cox are set to present a paper on Objective-C at this year's HOPL[4]. I wish it were as readily available as Allen Wirfs-Brock's JS paper for the same conference[5][6].
1. https://www.youtube.com/watch?v=QM1iUe6IofM https://www.youtube.com/watch?v=QM1iUe6IofM
2. https://www.youtube.com/watch?v=ljx0Zh7eidE https://www.youtube.com/watch?v=ljx0Zh7eidE
3. https://www.youtube.com/watch?v=vrRCY6vwvbU https://www.youtube.com/watch?v=vrRCY6vwvbU
4. https://hopl4.sigplan.org/track/hopl-4-papers#List-of-Accepted-Papers https://hopl4.sigplan.org/track/hopl-4-papers#List-of-Accept...
5. http://www.wirfs-brock.com/allen/posts/866 http://www.wirfs-brock.com/allen/posts/866
6. https://zenodo.org/record/3707008#.XtoRR-TEklQ https://zenodo.org/record/3707008#.XtoRR-TEklQ
- panic 6y agoThe HOPL paper is available here: https://dl.acm.org/doi/abs/10.1145/3386332 https://dl.acm.org/doi/abs/10.1145/3386332 (the PDF link even works without an institutional login!)
- cxr 6y agoThanks a ton! Earlier this week it didn't look like it was available. https://news.ycombinator.com/item?id=23436517 https://news.ycombinator.com/item?id=23436517 Looks like there's another Smalltalk paper, too: https://dl.acm.org/doi/abs/10.1145/3386335 https://dl.acm.org/doi/abs/10.1145/3386335
- foobar_ 6y agoEvery time you call a method you are breaking encapsulation because you can no longer change the name of the method, it is exposing the internals. Thats why Message Passing has more guarantees with encapsulation. Abstraction is overdone. Sometimes the simplest implementation is a function. Not a class. Inheritance is a failed idea of code reuse because it leaves the code brittle. You can develop GUI apps without OOP - Tcl / tk and some game programming guis are done that way. All that you need are callbacks essentially. Polymorphism is essentially overloaded functions and you don't need OOP to support that.
- pjmlp 6y agoPolymorphism is OOP, not every approach to OOP is the same kind of nail. Classes as concept, are nothing more than extensible modules, and in that regard C and Assembly are pretty much the only mainstream languages that eschew such abstractions. You can also develop GUIs in Assembly, and I don't miss doing that. Interesting that you mention Tcl/Tk, given the OOP extensions that were all the rage when version 8.0 came out. https://wiki.tcl-lang.org/page/Object+orientation https://wiki.tcl-lang.org/page/Object+orientation
- foobar_ 6y agoYou missed the first point I made. C++ / Java break encapsulation by using methods and pretend they are encapsulated. Julia implements polymorphism without OOP. Modules are better than classes anyways. The whole Java ecosystem tried so hard to bring modules back as components and failed miserably. If we are going to talk about all types of interfaces then OpenGL is a clear winner. That last time I checked it uses a procedural interface and vertex buffers directly. Why a procedural interface ? Because OOP is incapable of dealing with any complex data structure other than lists in a performant way.
- pjmlp 6y agoModules are classes without inheritance. C++ and Java don't break anything that a bad designed module won't be doing as well. OpenGL a clear winner?!? The 3D API that should never haven gotten outside SGI with its global variables and state?
- foobar_ 6y agoThat's exactly why modules are better than classes because they don't have inheritance. It allows for simpler solutions. No debates about taxonomies. OpengGL is faster. Procedural code is always faster. Global variables are infinitely better than pretending problems vanish with singletons and AbstractFactoryMakerProducer. I remember going from C++ to Java, what a joke. C++ is infinitely better than Java because it doesn't suffer from OOP monothinking which is beyond pathetic. It was the first time I realised programmers would repeat marketing slogans without verification.