3 ms·
That surprises me. My day job is programming in Java, and I use streams and lambdas everywhere. I use very little of OO concepts like inheritance. I try to m
by jimbokun 4y ago
That surprises me.
My day job is programming in Java, and I use streams and lambdas everywhere. I use very little of OO concepts like inheritance. I try to make my data immutable and write functions and methods without side effects, wherever possible.
Popular recent languages like Go, Rust, and Swift borrow a lot from functional programming paradigms.
I'm curious where you are seeing OOP still going strong.
- jackblemming 4y agoYou brought up the worst part of OOP, inheritance. Which most modern OOP rarely uses. Since the 90s “composition over inheritance” has been a mantra. If you want to build strong arguments, focus on real issues. Not incompetent programmers abusing inheritance or abstract factory factories, because they can write just as awful code in functional programming. There are plenty of actual OOP issues to hate on, but that’s because there is no silver bullet.
- zasdffaa 4y ago> ...inheritance. Which most modern OOP rarely uses huh?!
- akavi 4y agoWhat is OOP today in practice if inheritance is dead, as you say, and mutability is out of style, as I've notice in all of the codebases I've worked on since ~2014? It feels like we're just left with a heavyweight syntax for structs + functions bound to data, which feels like pretty thin gruel.
- wjmao88 4y agoWhat are things that are OOP specific (as in not used at all in FP) other than inheritance?
- JackFr 4y ago> Since the 90s “composition over inheritance” has been a mantra. That seems a little early. I think the 90's were still pretty inheritance-centric. Java only came out in 1996. UML 2.0 was releaeased in 2005. I'd say the composition over inheritance movement wasn't widespread until the 2000's,
- jackblemming 4y ago>[Composition over inheritance] is an often-stated principle of OOP, such as in the influential book Design Patterns (1994)
- JackFr 4y agoYou are absoultely right -- p. 20 "Favor object composition over inheritance", right in the introduction. I guess my memory was wrong (or I was hanging around the wrong crowd in the 90's.)
- wasifbaig 4y agoWhat are the real issues in OOP? The concept of composition has long been the bread and butter of functional programming paradigm since antiquity. OOP just adopted it later in the wake of nightmare inheritance hierarchies.
- zasdffaa 4y agoNot him/her but I'm writing a compiler, I use functional, sure, but most of it is AST objects, expression objects (which fit OOP very well), internal representations of other objects. Lorra, lorra objects. Working well.
- azth 4y ago> Popular recent languages like Go, Rust, and Swift borrow a lot from functional programming paradigms. golang doesn't. It's quite the antithesis really. They embrace mutability, no null safety, and only recently got generics.