3 ms·
I was alive during the rise of Java and it absolutely got a high amount of "Look at this piece of garbage" style comments. Particularly, people were VERY criti
by cogman10 2y ago
I was alive during the rise of Java and it absolutely got a high amount of "Look at this piece of garbage" style comments. Particularly, people were VERY critical of how slow java was and how much memory it consumed. There was also a fair bit of critique about the lack of language features. For example, java eschewed generics for a long time (not unlike go) which really irked people. It was very much seen as a more verbose C++ with few benefits.
- orbisvicis 2y agoI always thought that Java generics inspired python ABCs and later type interfaces.
- maleldil 2y agoWhat do Java generics have to do with Python's abstract base classes?
- orbisvicis 2y agoHmm sorry I meant Java interfaces, which makes this comment irrelevant and also I can't find the original supporting article - it might have just been an opinionated blog post.
- hn_throwaway_99 2y ago> Particularly, people were VERY critical of how slow java was and how much memory it consumed. To be fair, those were totally valid criticisms before HotSpot got really good. IIRC, way back in the day Corel said they were going all in on Java for their software suite, and they eventually abandoned it due to performance.
- hinkley 2y agoIt’s possible to write fast Java and one of the cornerstones of my early career was proving it. But I’d also spent a lot of time thinking about performance already before finding Java. A lot of people fully embraced the abstract nature of it while I kept it at arm’s length. I fixed a lot of really dumb mistakes, and a lot of things that were subtly wrong but with large consequences.
- o11c 2y agoFor reference: * JIT was added in Java 1.1 for Windows, and 1.2 for everyone else. But in the early days it sucked. * Generics, autoboxing, and enums were added in Java [1.]5 (2004). Prior to that, APIs had to use `Object` everywhere, explicitly wrap primitives when needed, and use plain ints for constants. * It's $CURRENTYEAR and Java still doesn't support structs, and it's not clear they actually understand the problem (since e.g. they force everything to be `final`).
- cogman10 2y ago> It's $CURRENTYEAR and Java still doesn't support structs, and it's not clear they actually understand the problem (since e.g. they force everything to be `final`) I think they do. The problem they are solving is removing indirection and flattening the memory representation of data. Making all the fields final opens up the JVM to some really neat optimizations you can't get with mutable fields. By the time you get something with enough fields in it that the immutability limitation becomes problematic, you likely would benefit from just having a regular class. Structs won't always be strictly faster than regular classes.
- fiedzia 2y ago>It's $CURRENTYEAR and Java still doesn't support structs they call it records, added recently. Depending on where you work, you may see them in a decade
- cogman10 2y agorecords aren't the structs OP is referring to. Instead, they are thinking of value classes. (at least, that's effectively what a struct means in C#). You will see `value record Point(int x, int y)` which is different from `record Point(int x, int y)`. The key difference being that `record Point` will create a reference to the x/y data with identity whereas `value record Point` will instead represent that data inline without a reference. I suspect that `value record` will be the way pretty much everyone starts using `record` as there's basically no reason not to.
- pjmlp 2y ago