Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
cuddlyogre1190354dI like composition more than inheritance. It's a bit more verbose, but a lot more flexible and less confusing.
-
devRancid631354dOop coders be like `class Table extends Cat` because it has 4 legs. Successfully made it DRY and SOLID 🤡🤡🤡
-
IntrusionCM14955354dComposition is almost always a step into an unmaintenable graveyard of mines.
OOP examples are usually useless. :-)
When you wanna learn OOP, one of the nastiest and sadly best tasks is to write import -/ export stuff.
Cells, styles, formats, value classes, aggregation functiona with value classes (median / avg / sum / ...), collections, learning stuff like immutability and that an immutable collection can contain mutable objects (one thing that some devs just not want to comprehend...) and a lot of other funky and gruesome stuff.
Plus probably learning to have an eye on memory consumption and thus learning stuff like iterators / generators / streams / ...
If you're a mean mentor like me and give people datasets starting with 4 MB and then growing the dataset exponentially. :-) (6 datasets, 4 MB, 16 MB, ... etc) -
MammaNeedHummus4448354d@cuddlyogre agreed! They say inheritance is the tightest coupling you can get and I can believe it
-
SidTheITGuy9592354dAnother try-hard dev trying to expose OOP as if it will change anything. SMH..
-
arekxv1054354dOOP is good when used correctly, composition is good when used correctly. Problem is in Developers wanting a quick and general solution to their problem.
Combine that with us saying "everyone can code" and you get a generation of devs hating any paradigm because they dont understand it well enough, create subtle bugs and code themselves into a corner.
I am no exception, but every pradigm has pros and cons and neither is THE solution to all of your problems.
The world just doesn't work like that. -
tosensei8375354d@devRancid what you're describing is "duck typing" - which is _literally_ the exact opposite of proper typing.
-
CoreFusionX3400354dLet's couple out with the fact (as so evidently demonstrated by some here) many devs don't really understand OOP or inheritance.
Classes are all about invariants, and most OOP inheritance chains (that includes examples, yeah), fail to understand that subclasses must not relax superclass invariants, yet do.
So in the end, they treat inheritance as a cheap way of achieving dynamic dispatch without thinking too much, and get flabbergasted when they discover that, for example, containers can't have their contents downcasted and stuff like that.
Related Rants
OOP coder:
OOP is so useful and realistic!
Let me give you an example -> Cat extends Animal.
Every other coder:
So how is that useful in reality?
OOP coder:
...cat pictures?
joke/meme
cats
java
oop