Originally published at deepu.tech.
Being a polyglot developer is fun. You are not married to a single language/ecosystem and you have a diverse t...
For further actions, you may consider blocking this person and/or reporting abuse
JVM is quite misunderstood. It provides much more than "portability". Take a look at benchmarks binary trees. It easily beats even Go. Why? Well JVM is also JIT or more accurately it contains JIT. This one can kick in after some time and provide such optimisation than no developer would think of at the time of writing the code. It changes your code based upon "experience" of usage. Now cold start is something else but having underlying "machine" that optimises code for you is quite nice for long running services. Cloud is not just services going up and down. Some work loads actually have "never-ending" services and that's where this is better than pre-complied code so to speak. It's not best it's just usefull in a lot of cases as "benchmarkers" usually like to do a quick test instead of checking process in real world running at least a month.
It's all a question of trade-offs. Java was designed at an age where developers thought that everybody would have machines with infinite computing power and infinite memory. On those kind of high-end systems, Java feels like the natural choice for complex projects.
However, the sheer overhead of Java is insane (not to mention dealing with dependencies...). I have a 10-year-old server with a quad-processor and 16GB of RAM which has reasonable performance, so long as it runs anything that was compiled (perhaps with the notable exception of PHP, which is a lightweight language, also with just-in-time compilation). Launch anything that uses a JVM, and bye-bye server — it will basically only run that single Java application and nothing else (granted, Ruby on Rails is almost as bad as Java).
Personally, I think that the time of Java is over. It's just due to sheer inertia that it's still being used and actively developed; that, and the fact that computer programming teachers still insist in putting Java in their curriculae, simply because it claims to be the programming language attracting the highest number of programmers. But this is a self-perpetuating illusion: there is a huge Java community because everybody was taught Java at school.
I was very excited when Java first came out, being a fan of C/C++, but feeling frustrated that there were so many portability issues back then. Java seemed to be 'future-proof' — and when you could embed it inside a web browser, it was a dream coming true. Finally, at last, you had a programming language that could pretty much be compiled once and run everywhere!
That basic assumption was insanely successful (also, it helped to have Sun backing it up — a company that did so many wonderful things for the computer industry and who got such a tragic end, being ripped apart by Larry Ellison...). The problem was the trade-offs it came with. These have naturally been addressed over the years (decades?) but it's clear today that there is a limit to how far you can push Java.
Basically, these days, Java is the Kim Kardashian of programming languages: it's famous because it's famous.
I actually agree with Deepu and JavaScript. Although it's unfair to compare Java with JS — and personally I prefer TypeScript over 'pure' JS; I'm not a huge fan of weakly typed languages, for many reasons — the truth is that JS basically followed the absolute opposite path taken by Java: once designed as a very simple scripting language to be embedded on a browser — and thus trying to have as small a footprint as possible — today it shines on Node.js (while remaining the last surviving option among browser-based scripting languages) and has acquired the level of complexity of a mature, modern language. Sure, I totally agree that the major problem with JS is 'too many implementations, too many vendors, too many differences among them' — a problem which C was also plagued with for decades, so it's not a new thing. And personally I really think that current JS programming styles rely far too much on reflection — I always wonder why people think that weak typing is so great when they have to spend most of their time coding reflection to overcome the problems inherent to weak typing...
Is JS the 'next Java'? Possibly. But I still think that, as a general-purpose language, JS is perhaps not the best choice overall. I'd be hard-pressed to do some serious system programming in JavaScript; that's a task better left to C/C++ (or possibly Go and maybe Rust). But on 'generic' applications, where time-sensitive performance is less of a requirement, I think that the choice between Java and JavaScript is narrower than ever, and, ultimately, I'd bet on JavaScript to win that race.
Then again, I'm utterly biased against Java, mostly because I had to maintain servers that run insanely large Java applications, consuming all resources and then some. Enterprises deploying Java extensively basically trade off developer time for system administration time; developers are allowed to pretend that they still have infinite CPU and infinite memory to run their badly-coded applications, leaving the fine-tuning to system/database/network administrators — but with Java, there is a limit on how much you can do to speed it up...
As you said you are utterly biased against Java. So I quite disagree in many ways with JS being replacement due to many issues including security and the way Node works. Java (mainly) uses Java modules without extra code for specific platform. Go looked great but it will take time to replace ecosystem which is by many Java devs actual reason why it's famous not the "Kim Kardashian" nor any professor putting it in the class. I was bombarded with MS tech in university and I still avoid those. So logic that it's being pushed is not relevant. Thing is you can try to kill it out and downgrade it's value but the quality of those libraries and frameworks is much better than JS ones. Some of us dislike forcing "rules" like never ever mutability and such so Go , Elixir and others won't hold water. I don't have problems with JVM because services I build are not bloated and I avoid reflection based tools. Example I use Micronaut instead of Spring when performance is important. I'm still waiting for a language to replace it in a way that libraries are easy to use but as well written just i that language. Node has too many C and Rust tools with interface to JS. PHP and python as well can't run specific modules on Windows because underlying implementation was a compiled language. Go looks nice yet you need to compile it many times for different platforms. It's about having seamless process of writing the code on one machine and working the same on the server. Regardless of that all this talk was about Java instead of JVM which is different. Kotlin, Scala, Groovy... A lot of tools from Apache like Kafka, Pulsar... Thing is there's too much to replace to kill it off. Just like PHP
You are absolutely right. Also can't stop laughing. This is a gem 😂
IMO java is a chicken and egg situation. It has the most mature ecosystem because it is one of the most used lang and it is most used because it has the most mature ecosystem. I'm just waiting for Rust's web dev ecosystem to mature, after that there is no looking back 😉 alternatively if generics finally happen in Go, that is viable as well
If generics get good in Go I would actually consider switching to it fully. Rust is a bit too much for SoA or microservices for my taste. Go looked easier but I'll give Rust another look. However I don't believe community would allow some changes (functinal devs are like class based devs that thought they are oop). Scala looked interesting however I didn't have time to switch to it but for you it might be again JVM. Unless you're up for native images with Substrate (Graal). 😁
Ya. Go could be a good compromise between Java and Rust. Rust does take some getting used and IMO harder to go back from once you are used to 😉
'a few years ago when Golang was all the rage'...
... well, I'm writing this in 2021, and as far as I can see, Go is still 'the rage'! :-)
Not as much as it used to be 😉
Wish there had been one pure FP language in here such as Haskell, OCaml or Clojure.
That is because I don't believe in pure FP 😉
haha fair enough I guess. Is it because you find it to be impractical?
Yes. I like to use the paradigm that works best for issue at hand. I like to do functional programming when possible and imperative/procedural/oop when necessary. Thats why the languages I like are multi paradigm languages. I like to use good things from all paradigm. For example in Rust I use monad like constructs (iterators, optional) and chain function pipelines all the time. But I also make use of traits (I know its not OOP, but the style is bit similar IMO) and I do imperative when functional code is too convoluted to write in some cases. Being tied heavily to one paradigm is restrictive IMO. Also in languages other than Rust/C++ you pay a price for doing heavy functional programming, while it might be negligible for most use cases, it would make a difference in performance critical use cases. For example I would always write for loops instead of recursion when performance is important (Except in Rust due to zero cost)