4 ms·
The crap people created on top was typically responses to deficiencies in the language, whether they knew it or not. Stuff like "everything is a class".
by pydry 6y ago
The crap people created on top was typically responses to deficiencies in the language, whether they knew it or not.
Stuff like "everything is a class".
- BiteCode_dev 6y agoDesign design does lead community culture. Java also had the unfortunate destiny of becoming popular at the time where "OOP all the thing" was a mantra in tech circles. Also design pattern were all the rage. Those things have a huge inertia, and while Java is not a much more flexible language, the image stuck, to the point that new comers still implement singletons in the wild.
- pydry 6y agoJava created that hype to market itself. OOP all the things probably wouldn't have been a thing without it, for instance. It was very much a marketed language and a language designed to be sold to top heavy corporations. This fueled a lot of the crappy design decisions, the hype and the culture.
- dragonwriter 6y ago> Java created that hype to market itself. OOP all the things probably wouldn't have been a thing without it, for instance “OOP all the things” predated (and led to) Java, it wasn’t a product of Java (C++, Objective-C, Object Pascal and, well, a bunch of other things from the late 1980s and early 1990s were where it got started.) Java was about a decade into it.
- pydry 6y agoThere's a big difference between "OOP is cool" (which Java didn't invent) and "OOP ALL of the things".
- doctor_eval 6y agoBut Java clearly didn’t “OOP all the things”, unlike earlier languages like Smalltalk. Java primitives are not objects (despite the fact that I often found myself wishing they were), and static methods are actually just functions. These days Java even supports first-class functions. I know not everyone will agree with me, and that’s fine, but I always found Java to be far more pragmatic than, for example, C++, which well and truely predated Java.
- dragonwriter 6y ago> Java also had the unfortunate destiny of becoming popular at the time where "OOP all the thing" was a mantra in tech circles. Java was a product of “OOP all the things”, it wouldn’t have existed without it.
- doctor_eval 6y agoI don’t think that’s true at all. Like most languages, Java has its share of deficiencies - I’d personally put null handling, type erasure and brain dead Optionals near the top of my list of things I’d change if I was King of Java - but fluent APIs and factory methods didn’t even start with Java, and have nothing to do with “everything is a class”.
- Pet_Ant 6y agoWhat is wrong with Optionals?
- doctor_eval 6y agoOptionals can be null, so dereferencing them can still cause an NPE. Also the syntax is horrible. I know the excuse that they are just meant to be used to wrap the return value of a function that might be null, rather than as a guard against NPEs, but that just means we’ve got a crappy, verbose Optional class ... and NPEs. It was the most half assed attempt to fix the billion dollar mistake [0] anyone could have come up with. It needed syntax and compiler support, not a stupid wrapper class. [0] https://en.m.wikipedia.org/wiki/Tony_Hoare https://en.m.wikipedia.org/wiki/Tony_Hoare
- sk5t 6y agoLikely to be addressed with the ongoing effort for value types. Optional + prudent use of @NotNull annotations can get you most of the way there already in practical terms.
- Pet_Ant 6y agoSorry but of course Optional can be null because of Java’s type system. Objects can be null, Optionals are objects. I’d rather it have been different from the beginning but now that it’s here it’s really not something that should change. Just never let anyone get away with returning a null for an optional... though I can imagine the scenario where in. A framework that might cause it to happen. To have special rules for Optional in Java is the wrong answer for a blue collar language at this level of adoption and age. They said they never want to make a change as big as generics again.
- blacktriangle 6y agoI have a saying for that: design patterns are a language smell.
- pydry 6y agoHa. Good one. I'm absolutely convinced that's true for some of them. I was never 100% convinced it was true for all of them.