4 ms·
The JVM itself is incredible, all the advantages of a fully native language with nearly none of the downsides, while being basically "third place" in speed behi
by exabrial 2y ago
The JVM itself is incredible, all the advantages of a fully native language with nearly none of the downsides, while being basically "third place" in speed behind C/CPP, and maintaining a gap in performance between the next closest competitors. The JVM also can do party tricks that no other language can with instrumentation and runtime class definitions.
I certainly appreciate the amount of R&D Oracle is investing into the Java Virtual Machine. While I use the open source version of the JVMs, I also wouldn't mind also kicking some cash into the back into the devpool. Business with Oracle does seem to be a bit of a poison pill unfortunately. Leaves us "small budget" firms in a pickle. We know the ecosystem needs funding, but the option to engage Big Red is not enticing.
- mrsilencedogood 2y agoI really wish Java had been like 5 years ahead on its modernizing push. That 10 year gap between 5 and 8 where the language __barely__ changed, while competitor languages were blasting, were just killer. Some might argue the reason the 8+ renaissance has been so successful is because it let other languages beta test, and Java took the winning ideas. Maybe so. But it gave Golang time to get big, which I like a lot less than Java. Especially when people try to use it as anything but a scripting language for grpc and a runtime for protobuf. But I think with virtual threads, esp when they work with synchronized right, will finally put Java back on top of Go. People complain about Java, but imo Java's problems are mostly accidental and acknowledged, and they do often get improved or fixed. Whereas Go seems to mostly be happy with how it is exactly right now, and are loathe to improve the many pain points. So much gocode is needlessly obtuse, and it's not like the obtuseness actually accomplishes their goal. I've still seen just god-awful Gocode, with layers and layers of interfaces in between you and getting anything done. Very java-esque, despite their OOP resistance being specifically targeting not falling prey to Java's propensity for towering class hierarchies.
- bane 2y agoWell there was also like 10-15 year period where Java was taken over by enterprise factoryClassFactoryFactoryClassFizzBuzz architectural cancer that really made things suck as a want to be user of the language. If you just stuck to the core language and the JVM, it's kind of always been a nice place to code even if the language was changing glacially.
- ok_dad 2y agoWhere can I learn about modern Java like you describe? I only remember Java from the days of "enterprise factoryClassFactoryFactoryClassFizzBuzz architectural cancer" and I hate the language due to that old memory, but I'm willing to try again. A lot of companies are using it in the industry I'm in, and it would be worthwhile to learn, but searching Google for Java resources is as much cancer as the enterprise stuff is.
- stickfigure 2y agoYour question seems odd to me. You had to learn to write AbstractFactoryFactoryService. Just forget it? You don't need a book. If you're used to writing nice concise code in other languages, just keep doing that, but in Java.
- renewedrebecca 2y agoExactly. I've been using Java since 2000, and I haven't once written an AbstractFactoryFactoryService. To be fair, I skipped over early versions of Spring.
- goalieca 2y agoThe ecosystem rewards inheritance and patterns. The language is and always was highly opinionated about OOP which is a flawed paradigm.
- stickfigure 2y agoThe Java ecosystem is vast and there is very little you can say about it generally. It's trivially easy to write Java programs without (ab)using inheritance. It's trivially easy to write Java programs in a functional style. There are countless libraries that will provide just about any programming interface you like, the only hard part is picking.
- syspec 2y agoThis is the classic example: https://github.com/EnterpriseQualityCoding/FizzBuzzEnterpriseEdition https://github.com/EnterpriseQualityCoding/FizzBuzzEnterpris... I've tried to follow along with it, but man I just can't - it's that crazy. It does work though
- superjan 2y agoThe JVM does not have ‘all the advantages of a fully native language’: fully native code does not need a runtime, or a garbage collector.
- malfist 2y agoSome would say a garbage collector is an advantage a fully native language doesn't have.
- jmartin2683 2y ago??? There are lots of examples of this.
- Jtsummers 2y agoD, Common Lisp, Go. All natively compiled (or can be in the CL case) with garbage collection.
- pfdietz 2y agoYou can bolt a conservative GC onto things compiled by an ordinary C compiler. https://en.wikipedia.org/wiki/Boehm_garbage_collector https://en.wikipedia.org/wiki/Boehm_garbage_collector
- caspper69 2y agoI know HN is not the place for this (because Microsoft), but I really like C#. The ecosystem has been MIT since 2016, and the last few releases have been solidifying the AOT proposition. It just has so many features that allow it to compete with C/C++ on the low level, but it also provides exceptional high level niceties (which admittedly can be slow, some LINQ for example). I know it's not fashionable, especially in a Linux-centric world, but I have used it extensively for many years (on essentially every platform), and it's lightweight (in most instances) and has the features and tooling to make development less stressful. Every time I use Java, it just feels overwhelming and slow.
- jeroenhd 2y ago
- 7e 2y agoJava is 3-5x slower than compiled languages, with horrible and uncontrollable tail latencies due to garbage collection. The bytecode thrashes the icache and the language is overly abstracted and too verbose. You have to install a huge runtime to use it. Many frameworks abuse the language to make things monkey patched/non-obvious. There's a reason many projects are rewritten in native languages. Java does have a place, however, for I/O bound workloads where developer productivity matters more than performance. You can write a lot of horrible code in Java very quickly.
- chii 2y ago> Java does have a place in fact, most projects don't have the kind of performance requirements that would make native a necessity. I say, java should be the default, and native have a place.