4 ms·
Object-oriented languages are Dead Men Walking due to the problem of global mutable state management in any medium- to large-sized codebase, coupled with depend
by pmarreck 11y ago
Object-oriented languages are Dead Men Walking due to the problem of global mutable state management in any medium- to large-sized codebase, coupled with dependency/inheritance hell, leading to complexity hell, leading to geometric progression of tech debt. Compounding this is the lack of good unit test suites across the board, meaning that even if you write absolutely perfectly tested and maintainable Python (or Ruby, or Java, etc.) code, you still are stuck using libraries that have not been written with that in mind.
And yes, I'm talking broadly about the rise of FP.
- pjmlp 11y agoYou mean all those FP languages that happen to support OOP as well? Lisp, Clojure - CLOS OCaml - The O is for Objective, e.g. Objects Scala, F# - Hybrid FP/OOP Haskell - Type classes support polymorphism and extensibility. Erlang - Message passing as envisioned by Smalltalk So what are FP languages that have zero support for OOP concepts and are on the rise?
- provemewrong 11y agoTo be pedantic, Clojure has nothing to do with CLOS. It does leverage JVM and lets you use objects and OOP patterns though.
- pjmlp 11y agoSo where do you think multi-methods and protocols come from?
- provemewrong 11y agoOkay, TIL, still there's more OOP in Clojure beyond CLOS influences.
- aninhumer 11y ago>Haskell - Type classes support polymorphism and extensibility. While most of your examples are valid, I don't think Haskell is remotely object oriented. Type classes are not classes.
- pjmlp 11y agoAny Haskell coder knows that. Quoting myself > ... support polymorphism and extensibility. OOP isn't only the C# and Java view of the world.
- aninhumer 11y agoPolymorphism and extensibility are features of OOP, but Haskell implements them in a rather different way to most OOP languages. I realise people disagree about what exactly should be considered OOP, but personally I think not including inheritance in the definition broadens the term beyond usefulness.
- bulutsuzku 11y agoThere is no disagreement, Smalltalk is the object system. Object-orientation was invented in Smalltalk. Other languages and systems are just poor imitations.
- pmarreck 11y agoBeing a "hybrid FP/OOP" language is like taking a pure soup and allowing anyone to put a little bit of fecal matter in it and still thinking the product is "A-OK." ;) Opinion aside, it's still true that some classes of algorithms are still too slow in FP and benefit from procedural mutation of state. But those should be managed very carefully as they destroy concurrency. I linked it elsewhere here but I think John Carmack's comments on this are quite lucid, and he is merely talking about using a functional style within OO languages: http://gamasutra.com/view/news/169296/Indepth_Functional_programming_in_C.php http://gamasutra.com/view/news/169296/Indepth_Functional_pro... The thing is, 16-core CPU's are coming out soon, and we still have 99% of software that cannot take advantage of that well, at least within a single process. One clarification > Erlang - Message passing as envisioned by Smalltalk Smalltalk, despite being called an "OO" language, did not come up with the gigantic class inheritance chains which have been attributed to OO.
- balamaci 11y agoYeah they will still probably be labeled as dead man walking for the next 20 years long after your FP langue de jour will have outlasted it's pristine days and got damned to hell by the devs having to maintain the programs written in it. Don't get me wrong if you are currently doing consultancy business for a niche FP language far for me to blow the wistle to companies that instead of paying your fees and hefty salary for that rare programer(who might be me) who would have dabbled in your obscure language they would be better of paying 10$ a month and get 2 more DigitalOcean instances to support the rise in traffic your non sharable state code is solving.
- 15155 11y agoIf you're working a problem capable of being solved by two $10/mo DO VMs, you're working a problem that can be solved in /any/ language.
- balamaci 11y agoI'm amazed by the number of people that declare the shared mutable state of the current languages as their bottleneck. You'd think everybody is suddenly working with realtime stream analysis on huge datasets and are battling millions of concurrent users these days. My thinking is that if you are so popular you can afford maybe to start 20 more 5$ instances. And really I find it hard to think of problems that cannot be solved with 20 x 5$ DO VMs at least in Java.
- BuckRogers 11y agoYour comments are probably not intended to make anyone laugh but I'm enjoying them. But what you're saying is so true. I'd like to take it a bit further and add there's a reason while the implementation is slightly barbaric, Node.js continues to thrive. While I don't use Node, I have, and tend to think making things even more 'regressive' than say, Java, is the right way forward for most work. Writing multi-pthreaded Java apps is not my idea of a good time. I am very interested in Elixir, but at the same time recognize that in reality I use Python. And if folks want to knock themselves out writing multithreaded Java apps... to go use Java. I think the Node model for most, if not almost everything, fits needs well with its single-threaded event loop and scaling by process. Explicitly spinning up pthreads should be reserved for systems-programming, and in which case you are probably going to be using C(++)/Rust(?). >You'd think everybody is suddenly working with realtime stream analysis on huge datasets and are battling millions of concurrent users these days. I almost want to archive this somewhere or put it on a plaque next to my desk.
- ArtB 11y agoObject oriented does not require state: it requires encapsulation. I incorporate as much immutability into my code as possible and I would say most of our objects never have their state changed from instantiation and I write Enterprise Java all day long.
- vram22 11y agoInteresting that FP started from as long back as the time of John Backus (of Backus-Naur fame): https://en.wikipedia.org/wiki/John_Backus https://en.wikipedia.org/wiki/John_Backus Not taking any sides in this beef, though, just an interested bystander.
- vorotato 11y agoThis either or thinking is not very productive. FP existed before OOP, it's hardly reasonable to think it will replace it.
- lladnar 11y agoWeddeddSsx