4 ms·
Sorry, what? Is not java toghether with Ruby maybe the most hardcore OOP enthusiasts that uses inheritance for "most stuff". Has the java culture move so far t
by sisve 3y ago
Sorry, what? Is not java toghether with Ruby maybe the most hardcore OOP enthusiasts that uses inheritance for "most stuff".
Has the java culture move so far the last decade ?
- fiddlerwoaroof 3y agoI’ve been writing OOP code and reading about it for a decade or two, and inheritance was identified as problematic pretty quickly. The problem today, imo, is more underuse now.
- fuzztester 3y ago>inheritance was identified as problematic pretty quickly Exactly what I referred to here: https://news.ycombinator.com/item?id=37539443 https://news.ycombinator.com/item?id=37539443
- fiddlerwoaroof 3y agoYeah, it’s a bit like how the school version of lisp makes people think real lisp code bases are all lists and recursion.
- dragonwriter 3y agoEven in Ruby, IME, deep inheritance is fairly uncommon. Wide inheritance through mixins is common, though.
- EdwardDiego 3y agoEffective Java, written by Joshua Bloch, and first published in 2001, had a very influential section called Favor composition over inheritance: https://books.google.co.nz/books?id=Ra9QAAAAMAAJ&q=inheritance&source=gbs_word_cloud_r&cad=4 https://books.google.co.nz/books?id=Ra9QAAAAMAAJ&q=inheritan... Why do you think DI is so prevalent in Java codebases? It's a great way of simplifying composition.
- fuzztester 3y ago>had a very influential section called Favor composition over inheritance The GoF book (Design Patterns) had the same, somewhere early, like in the Introduction, in 1994: https://en.m.wikipedia.org/wiki/Design_Patterns https://en.m.wikipedia.org/wiki/Design_Patterns
- kaba0 3y agoFunnily enough, it actually started from C++. And, Java is so large that it is simply meaningless to talk about a unified style -- sure, some Java EE behemoth will continue to run on a complicated Application Server for decades still, churning on its workload, but so will someone write a Micronaut microservice, or something for robotics, and these will all have distinct styles. With that said, even the Java EE/Spring complicated word has been moving towards a less inheritance-based future.