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
-
The very first reply explains why abstract and static are oximorons.
Static method wont call the constructor, thats pretty much the point of being static, that they dont need a serialized object.
"Subclasses cant have a common constructor" uh what? You know super() exists right?
You want to map a collection of what exactly to objects?
To me it seems it aint java thats stupid huh -
I don't understand why anyone would ever need this... But I do know that you can provide default implementation in super classes.
-
Awlex177456y@ganjaman
And one of the comments points out, why that's BS.
If I want to return an object from that particular class, I'll have to call it's constructor eventually.
I know what super(), is. I probably worded that wrong. I meant common constructor as in accepts has common arguments, but does different under the hood. Essentially MAPPING the contents of argument to either perhaps another constructor.
For the collections, just imagine a (stupidly) deep nested api -
devios157016yIf I’m not mistaken, Swift actually supports overrideable class methods that can be invoked by use of a dynamic call at runtime.
Related Rants
Today I found a faulty design choice in java, that seriously makes me hate java. Basically java prohibits abstract static methods. This -combined with the poor design choices for constructors - means that Subclasses cannot have a common constructor or static method calling the constructor.
Basically meaning that you can't just map a collection to objects without handling EVERY FUCKING CASE, WRITING THE WHOLE MAPPING AGAIN AND AGAIN, ADDING A FORCED PORTION OF SPAGHETTI WITH EVERY CLASS WHERE THIS WAS NEEDED.
https://stackoverflow.com/questions...
There seem to be other OOP languages with this faulty design. Can't say if I now hate OOP ingeneral or not, because maybe some languages may have provided a substitute for this
rant
stupid oop
stupid api
stupid java