Java Is Underhyped
jackson.sh
jackson.sh
- not high level enough to compete with Python/Ruby/JS/PHP, etc
- not low level enough to compete with Rust/D/Nim/Zig
- not specialized enough to compete with Erlang/R/Go/Julia
- not opinionated enough to compete with Lisp/Haskell
So why use Java ? It's good, it's fast, it's productive, it's well supported, battle tested and documented for decades with a huge pool of devs. And many companies already use it and the tooling is excellent.
But those are not sufficient reasons for me.
Python is older than Java, well supported, battle tested, documented with a huge pool of devs. But it's way better for high level stuff, data mangling, scripting, gluing, and for most web dev stuff.
If I want a distributed system or something with a lot of I/O, Erlang and Go will always be better than Java. Sure, they are less widespread, with all the stuff it implies, but for such a nice need, I will pay the price hapily: my goal is optimization for the use case. Same for stuff that needs to go fast or have a small footprint, I'm not going Java if I can go Rust.
If I want to have fun, Java is out of the loop. Better sharpen my inner weirdness by fighting with some exotic lisp. Why try productive ? I wanna enjoy myself, not run a business.
So Java is not a bad choice. It's an excellent tech. I just don't have a use case for it.
Java is typically used in larger or long-lived organizations. It is rare to start new projects from scratch. Most development is maintenance and extension of existing systems. Even if you start a greenfield project, it would be most prudent to chose the same platform and language which is already used in the organization. An alternative language would not only have to be better, it would have to be very significantly better to make up for the overhead and headache in maintaining code in multiple languages - never mind the increased difficulty in hiring and training developers.
Geeks tend to evaluate language based on how appropriate they would be for a greenfield project with no organizational baggage. But this is an extremely rare use case for most business.
HN often has reports about startups rewriting everything from scratch every four months, when a new language or platform becomes fashionable. But this is not the world where most developers live.
Anecdotally, I see a trend of greenfield projects moving from Java to NodeJS. I can't think of too many organizations that have zero web presence, and basically any modern web presence requires the use of JS, so there's almost always some JS expertise built into the organization.
It's orthogonal to my point though.
Java is like you say not the greatest at anything but it is also not the worst at anything. Its great for projects where the you don't know what you should optimize for or don't care.
If java is to boring maybe kotlin is the way to go. I really like kotlin and in my personal experience the only downside is that the IDEs is not as good as the java counterparts yet.
But my main complaint about Python is trying to use someone else's software. Then it degenerates into a maze of twisty little passages of trying to install the correct set of dependencies, not knowing where those files are installed (which makes it difficult on a cluster, as you may need to do the install on every node separately). Then you try using pip and it fails because some element of what it is trying to install isn't compatible with your operating system for reason 1. So you try anaconda instead, and that fails in a different way, like it runs a C compiler on some file (!?) which fails because $REASON. I have numerous examples of Python software where I have followed the (detailed, precise) installation instructions, and it doesn't work.
Whereas with Java, you just dump the necessary jars into a directory, include them in the classpath, and it works.
Don't get me started on R.
You know the joke: a dev has a problem, uses Java, and now has a ProblemFactory :)
Not to say Java is not a great language for big projects, it certainly is well equipped for that, especially because it has superb tooling available on the market.
But I've done plenty of big projects in Python, some ended badly, some ended great. Not to mentions dropbox, youtube and instagram are testaments to Python can be used in large projects.
So I don't think Python is unsuitable for big sized projects. You certainly do have to worry about different problems than in Java, especially for projects that started without type hints. In my experience though, you reach less architecture dead ends with Python because the language is so flexible that a bad decision early on can easily be transformed or worked around even very late in the project without much fuzz.
So I don't use "size of the project" in my consideration to not user Python/Go/Rust/etc over Java.
Mypy is excellent. It has two-way type inference like Haskell. Good usage means catching almost all type errors before running.
So is PyCharm, which is IntelliJ for Python.
How do you mean? What IDEs are you referring to? Kotlin is fully (and very well) supported in IntelliJ Idea - unsurprisingly so, given that it's JetBrains own invention...
The reason Java does compete so successfully is that it is high level and yet provides a virtually unmatched combination of performance, maintainability and observability (including always on, low-overhead deep profiling). None of the alternatives you mentioned come close. This is why it continues to be a top choice at Amazon, Apple, Netflix, Google, Alibaba, Uber, Soundclous, and almost all Fortune 500 companies. Saying it is "out of the loop" is either wishful thinking or delusional, depending on your perspective. It's just not the reality.
I'm just saying, "to me, that's why I never end up using java".
Java is good enough for the vast majority of things. But so is Python.
And for specialized things, there are better choices available to me.
I'm not a Fortune 500 though.
"Running Java" requires detailed system engineering / ops expertise specific to how the JVM works and can be tuned, and all too often, how specific frameworks internally pile their abstractions on top of each other. Problem is, a modern "Java app" is a pile of large frameworks and libraries.
As a system engineer, I HATE Java applications written by clueless programmers. They are difficult to handle and I often have to dig in and fix bad usage of framework features that somehow passed code review by equally clueless "senior" developers. I then get to spend a day to find out why this or that connection pool in there managed by this or that library does not handle its connections correctly, just to find the magic framework level variable that tunes that specific screw. Stuff of nightmares.
Every Java project is also __severely__ underdocumented. That's because even if you write documentation for YOUR code, the framework has books of documentation on ITS specifics, and includes high-level libraries which THEMSELVES have heaps of specific documentation. Climbing the tree until one arrives at actual standard library calls is like climbing into clouds and hoping to see the sun some day.
Endless abstraction, loading giant things into RAM, looping over every item in huge arrays. Blocking server threads for minutes at a time. In most languages you would be punished severely with awful performance or OOM. Java chugs along until things get horrifically bad.
> almost completely disregard how that code works on the JVM
As an occasional clueless programmer, I've had occasion to touch systems written in Java. Could you point me at some resources?
This weaknes stems from Java being OO. On larger projects you start to have abstractions which tend to be insucfficiently documented or the documentation not being updated with changes. Throw in some helper classes here and there, from a certain point of complexity of the project from an outside perspective the whole thing looks like being obfuscated.
No one dreams about garbage trucks or puts one in a car show but they’re there and ready to go right back to work when you are.
- you can integrate code from hundreds of developers fairly safely (knowing that no one has changed the default behaviour fo builtins and different dependencies won't clash).
- the syntax, although not the most succinct is fairly easily readable and maintainable by other developers.
I dislike that people conflate simple languages with easy to read code.
Low level verbose abstractions make code harder to read - going through the layers of IFactoryRepositoryLocatorBullshit because the language abstractions suck doesn't make it easier to read code.
It makes the code more accessible, in the sense that you can probably find some 20$/hour devs to read through that and spend a day solving something that should take a couple of hours most.
Good high level code express the problem domain without boilerplate and let's you focus at problem at hand - Java is terrible at that.
It's exceedingly rare for this to be untrue of Python — it's technically possible to hack builtins but there's intense community pressure against doing that.
> - the syntax, although not the most succinct is fairly easily readable and maintainable by other developers.
This is sort of true but it misses the aspect which makes Java hard to maintain: the language being less capable means that you end up with more boilerplate syntax which has to be understood when reading it and the patterns that produces tend to be the long-term maintenance issue instead.
But even for Python (which syntactically speaking is probably the easiest to read of all the list), if your team scale, you just scale the tooling with it.
The Python ecosystem is very rich in tooling for enforcing best practices. Poetry will manage dependencies cleanly. pylint will let you check that builtins are not overriden. Mypy will check for types.
So of course, it's not as good as Java, but again, the post is about compromises the language make, which are not the proper ones for me, personally.
The language itself isn’t great though. Java solutions tend to be bloated and make it hard to decipher the underlying domain logic.
I certainly wouldn’t pick Java for a small team of experienced developers.
Though it seems java in general attracts a culture of slow moving bureaucrats which doesn't necessarily translate into higher quality (in fact, I'd argue it translates into worse quality).
Now, from a project success perspective, I think it's not. I've seen a lot of Java projects fail, over engineered, full of spaghetti code, riddle with inscrutable abstraction, stuck in a glue of badly designed architecture that has been fossilized by the type system.
I'd say from a project risk perspective, it's a pretty average language, it has pros and cons, but they balance each other.
The language is underwhelming, the JVM is great.
If I needed to waste more time on hacking a setuptools script, to get a file placed into /usr/local/lib/shared... I'd rather use Go or Rust.
It's way easier than C++ and will get you 80 percent of the way there in terms of performance
They cannot fully embrace the JVM while targeting ART, JS and native at the same time.
We are talking about Java as a language, not the JVM as a platform.
You can also run Python on the JVM.
Although, some Java compromises are definitely linked to the JVM.
But Erlang was just such a good fit for this project. I wasn’t so huge on the Java version of Akka. I also briefly looked at Scala, but I avoid Scala for similar reasons to C++ and Haskell. The nativess of a lot of the features I wanted to Erlang just looked better and it will be a cool homage to the language’s roots.
Also this is probably more my fault, but I don’t really understand how distribution works anymore. Supposedly Oracle JDK is no longer supported and you’re supposed to package a JVM with your application, but all the big Java apps still require me to have a system wide JVM to run them? OpenJDK seems to work fine for now.
Also after toying with a LAPB implementation, I’m so mad other languages don’t have a good type for dealing bit level data. Bitstrings are a godsend.
So you can just install OpenJDK from a package manager, use the jlink tool and create your own small “JRE” that you want to bundle. Jpackage can create a platform native executable from that, that is either an installable exe, .deb, rpm or MacOS’s format (I forgot it’s name)
Scala has a "tunable" level of PL feature usage; you can write very Java-esque Scala at the beginning and slowly incorporate more advanced features.
The key thing about these features are that once you understand what they do, it allows you to write fewer lines of code overall. Fewer lines typically means fewer bugs, and it communicates intent with more clarity (at least to developers who are familiar with the patterns).
This makes it easy to onboard new devs who may not know a lot of Scala and let them be productive from day 1 (writing Java-style Scala) while advancing their skills towards more fancy idioms.
I have stayed away from JVM-land after taking a different tack in my career trajectory, but I worked at Twitter about a decade ago when they were transitioning to a JVM-based stack and were early adopters of Scala. It was really a joy to be able to simultaneously get my work done while uncovering all of the new cool language features!
IMHO, YMMV etc.
If I don't need performance, Python is ok.
If I do, I won't go Java, I will choose something that is built for performance. Python is good enough for 99% of my performances need. The last 1%, jumping to java is not a big difference, I'll use rust or go.
I won't use go for the ecosystem, but it's unique characteristics: easy concurrency, dead simple binary production. Java can't beat that. IF I need an huge ecosystem, I'll go Python.
For the need for Java, I would need this very specific sweet spot where I need just enough speed, and just a rich ecosystem enough to justify it, and nothing that is a killer feature in alternatives. And a situation where compromise over this is not possible.
It never happens to me, that's all.
* performance is not really an issue for most software ("97% of the time, premature optimization is evil"). A well designed software doesn't suffer from performance issues with current computer performance, unless you do AI or bleeding edge graphics or science simulation.
* there are ways to speed up performance sensitive parts with something else than java, for example by using C/C++, would it be with a python module or cython. Not ideal, but generally you gain performance by adapting your design, not by changing languages. A garbage collector is rarely predictable, hence java is not a good fit for performance.
* I remember playing minecraft with friends, and the server was regularly crashing because it was out of memory, or something like that.
What I love about Java is, that I can update the runtime without being afraid to break something. I also love the mature eco system. What's also great is that the compiler catches most code issues before you try running your code.
What I don't like is the module support introduced with Java 9, which is vastly inferior to OSGi.
- Python: 1991
- cryptography: It has a wide range support of symmetric/asymmetric algorithms from legacy to modern ones.
- XML and SOAP with Web Service Security in particular.
- Modeling large business concepts because of static typing, Objects inheritance and polymorphism, no memory management while still being performant. I would not use Python for that but other languages can compete C#, Scala, Kotlin, maybe Typescript.
The cryptography module in Python is awesome. lxml and sud deals with XML and Soap in a blink.
Modeling large business concept is a joy with dataclasses, and the language will never be the perf bottleneck.
Now I understand that if you are experienced with Java, it would solve all those problems perfectly.
But again, I would not, personally, gain anything by using it for this.
Startup times are not an issue on servers as processes are typically long-lived anyway. It is a bit of an issue on serverless (lambda etc.) but that’s a relatively new thing. High memory usage is generally poor tuning - if you give the JVM 1gb it will use it and avoid GC until it needs to. Sometimes it’s poor coding too, I’ve seen web APIs accepting files as base64 encoded json strings which is horrific server side.
There was just not much interest in it, because performance gets worth, and startup time is seldom interesting. (Pretty much only command line tools would require faster startup, and recent serverless)
And memory usage is a tradeoff. Though most of the time java could run with almost half of the currently used memory, it is unnecessary work to GC if memory is available.
I learned Java on gcj (gcc support for Java), and it generated executables. I've no idea why they killed it. Maybe someone more in the know can explain.
Interesting - you seem to be saying that Lisp is very opinionated. If that was your intent, may I ask why? Your experience doesn't jibe with my experience as a Common Lisp user, which is that Lisp isn't opinionated enough, and gives you too much flexibility (in some cases).
I think the opinion you're trying to convey is "not untyped enough".
WELL SUPPORTED???? Have you ever coded a real thing in python?
I'm getting "Warning, no longer supported" console messages in all my basic well established tools and libraries written in python because a guy that lives in a world of academics and theory and not in a world of business and delivery dates decided that python3 was not going to have backwards compatibility with python2 because they made a massive irreparable disaster when they designed python2.
That is not a professional tool for multi-million dollar companies, that is a toy for spoiled nerds. Exactly the same that Visual Basic 5-6 were when I was starting. Extremely easy to use and extremely fast, at the price of been garbage for anything larger than a toy app.
And because all the kids learned that at uni and went to create the next thing in it like PyTorch and TensorFlow, now you have to do all the real code in C / C++ to handle what python can't in terms of speed an reliability, doubling you code base, your Dev teams, and the needed skill set.
I have been programing in java in large multinationals for 10 years and I used python every single day for the past 3 years for what its useful: small hacky scripts to increase productivity. The real sh*t that manages you cellphone towers, you home-banking, you online shopping, your logistic chain and your android cellphone apps, all things that I have worked on, gets done in Java.
I myself have coded a streaming platform getting half a million user every day in Python. Baring the CDN to store the content, it runs on 2 servers, one for the DB.
So real things get done in Python pretty well.
Based on what?
I think if Java's new features are an attempt to woo new developers, Java comes off pretty tragically, like the old guy in the club, trying stay relevant by showing off how it just got up to date with ideas that hit the mainstream ten years ago. Whoa, check out these record classes! Fresh stuff over here! I don't think there's any significant audience for this (a few "ignorant computer science undergrads" aside,) and I doubt that's what Oracle is shooting for.
I think what Java is really doing is reassuring people who committed to it long ago that it will take care of them. Java is not the old guy in the club; it is the middle-aged guy dressing up and taking his wife out for a night (or half an hour, depending on her arthritis) of dancing at a jazz bar. It's doing its honorable best to show the people who committed their lives to it that it understands they still need a little bit of excitement now and then, and they don't have to sacrifice their dignity to some cad at the bar at the country club to get it.
They don't really want to leave Java. Java understands things about them that nobody else ever will. All Java needs to do to keep them is love them enough to keep doing its best.
I'm sure that Java developers have a vision which they're moving to. They're trying to convert old language into a new one with immutable classes, pattern-matching, green threads, modular JVM, all that stuff. May be I'll like that new language, but so far I'm a little bit unsatisfied. And, as it seems, young people are not that impressed either.
But why would they bake in a misfeature? Yeah it is popular, but was never a good idea to begin with. Records and new language features try to slowly shift the focus to a more immutable, FP-oriented style of OOP, which is imo a good decision. Of course it doesn’t make imperative code legacy, the two worlds can coexist perfectly.
> Modules are weird thing that nobody asked for
This is the feature that allows the JDK team to do their work. You either expose the internals and freeze it, effectively killing the platform, or encapsulate it. It is/was a great decision, and it didn’t broke too many things.
I agree that it's underhyped. You can pick a lot of other languages, but no other language is as broad as Java.
Python reads like a dream but has useless perf and threading.
Javascript (Node et al) has the I/O concurrency but no clear solution to threading, and is bad at number crunching.
C++ has good perf but is overly complicated, compiles take forever, no good module management, etc.
Rust is great but super-hard to learn.
Golang lacks tooling and perhaps some libs, albeit being a really good contender.
Naturally there are other languages to bring up, but I personally think that Java strikes a good balance. The language itself doesn't really have any clear weak points anymore. With lambdas and streams, even FP is succinct in it.
The only thing really speaking against Java right now is the culture of overly complicated frameworks with too much meta-programming and magic. And the fact that the market of lightweight alternatives is too fragmented.
My guess is that they're not trying to win over people from other languages with these features, but rather to not give Java people a reason to move to other languages. Why move (legacy and lock-in aside), when Java has the features you're considering moving elsewhere to get?
It might not be what you choose for a new company, but it may not be fashionable here but it is very common and quality of life improvements are welcome.
I’ve kinda started to like Kotlin from syntax perspective & Go’s nature of compiled and low overhead prospective. I wish somebody can combine those together (don’t tell me GraalVM).
Guys, c'mon, get your head in the game. Before we tech out how under hyped JAVA is we still never sorted out just how awesome VI is and how VI is way better than EMACS, Code Lion, and whatever other crazy complex IDEs are out there. Once we figure that out, only then can we afford to resolve the lesser pressing problems.
Yes, it's one of the few mainstream titles where Java has been successfully applied, but I believe Minecraft's success was specifically because it was written in Java.
With no JVM, there would have been no Minecraft mods at the level of flexibility that Forge provides, and the game would probably have stagnated in comparison with the sheer amount of community content from the past ten years that's available. Being able to use libraries like ASM that allow you to transform the compiled bytecode in radical ways were possible only because Minecraft targeted a virtual machine. The incredible thing was that this was in spite of the obfuscation Mojang applied to the compiled source. If it was possible to create a flexible mod system at all thanks to the JVM, people were just too motivated for any deterrence to stop them.
For the people who say that Minecraft should have been written in C++ or something from the start, because Java is a mediocre programming language, there's Bedrock Edition. Nobody I know cares about it enough to play it. For all its bloat and performance issues, the benefits of the JVM were simply too convincing.
Been playing for just under ten years, everyone I know plays Bedrock these days. I built and manage a very popular tool / Minecraft community and while I don’t have actual numbers, my general sense is the majority of players run either console or mobile Minecraft - all of which are Bedrock at this point.
If you don’t care about modding or particularly complex redstone, I don’t know why you wouldn’t run Bedrock. It’s far more stable, reliable and performant. My laptops fans rarely come on in Bedrock but never shut off in Java.
In my eyes Java is the public prototype / feature target and Bedrock the actual product.
Java is a language with mandatory GC, tiny objects scattered around the heap (poor locality), and no value types or low-level memory access.
This makes it very poor for games (you know, other very basic ones).
But they're rapidly addressing these concerns.
I think this is because of the way it handles memory. It's like the clunkiness of C++ without the power to optimize. Also, compared to python it is fast, but not compared to C or Rust.
That said, for 99% of applications the Java garbage collector is safe and tends to produce reliable code. The article is right in that Java is an extremely useful language with good tools. Games are an edge case.
The GC is constantly overworked because Java has to allocate immutable vector and matrix classes on the heap.
In other languages (like C# for example) you'd make that a struct and enjoy value type semantics and stack allocation (in most cases).
Regarding modding, I think if the game is successful, then there will be at least a small handful of people that write a modding interface for others.
It's the version used on all handhelds and consoles.
Java has a branding problem. Java (and Oracle) missed the wave of the last 15 years when tech became "cool." If you were new to tech/programming and wanted to pick up a language, which of these three would you pick, based on the website?
- Java: https://www.java.com/en/
- Kotlin: https://kotlinlang.org/
- Scala: https://www.scala-lang.org/
Java just doesn't have the cool factor that other languages have. A little rebranding could go a long way to reinvigorating the language in the eyes of newcomers. And I say that because the author of this blog post is a newcomer. Experiened developers know that, despite the ugly Oracle branding, Java is a good language with a sophisticated ecosystem of tools surrounding it. He seems to be mostly enamored with the developer experience of IntelliJ + Java + Maven. And while it is great, that experience is possible with most programming languages.
Disclaimer: I haven't used Java since my early University classes 10+ years ago.
Don’t pool it all together with this Java website - which sucks but not because it was from 2010.
I abhor and loathe modern web design.
The Java download button looks clickable without me having to hover over it. The Kotlin "get-started" link doesn't look clickable, because it's next to a different link that has a different style (both actually are clickable). The Scala one has a download link that also doesn't look clickable.
Rubbing salt into the wound, if you click on the second link for Kotlin ("learn more"), the back button doesn't work.
Summary
Java website: made as obvious as possible, prominent download and search interface on main page; type in your search and press enter.
Kotlin: Links differ in appearance from each other, back button broken for some links, which don't even look like links. Cannot type in a search term until after visually finding and clicking a search icon. Then you type in your search term (two-step process).
Scala: download link looks like neither a link nor a button. Never found a search button. At least "Back" works.
I have to say, the Java landing page works best. That your personal preference is for less obvious and less simple user interfaces doesn't make the simple and easy to use interface a bad choice.
What is really going on here is that there isn't a "the Java website". There is no single organisation or project behind Java which could put such up a website. Similarly, where is the C++ website? The C website?
java.com was originally the website aimed at end-users who need to install Java to use desktop applications written in Java. It looks like it's from 2010 because that's when the last of those went extinct.
C website: http://www.open-std.org/jtc1/sc22/wg14/
- https://www.oracle.com/java/technologies/javase-downloads.ht...
If I go onto my GitHub and try to get any of my old projects running I am extremely confident that the non-Android Java ones will still work. All of the other ones will probably have "rotted" over the years and send me down a day-long rabbit hole looking for old dependencies or build systems.
There's something to be said for that amazing stability. I can't think of another language where you can find some .edu page from 2001 with a link to a library (.jar) that does what you need and you can actually use it in a modern application.
Doesn't mean we don't touch old code (change idioms, generic safe, build process etc). It means we do it when there is value to us for updating it. Not because we are forced to due to an infra change.
At the same time code that ran on a PA-RISC machine now happily runs on a mac arm (even then it was great because the same code ran on PA-RISC, powerpc, x86 and X86-64).
If that code was written in python it would have likely gone through two breaking cycles at least. C sure that would have worked but the cost of having it working such a variety of systems would have been humongous for a small group like us. What real alternatives have this claim? C++ chances that I can compile code from 2000 without issues is minuscule.
Sure I had my EJB "fun", and when I look at some of the micro-services being deployed I see the same problems. Because they are reflections of organizations. (i.e. sometimes have the feeling that changing language in an org is like switching your in-office communication to Italian, because it so fast and romantic.).
Just because there was "bad" code written in the past doesn't mean new code is done that way. Yes it exists, yes it needs to be poked once in a while, but that is a lot cheaper than rewriting in a modern style.
I LMAO when Python changed (or broke...depending how you look at it) the basic print functionality between version 2 and 3. Meanwhile I can use the latest and greatest JDK to compile old java code.
Don't get me wrong, I think Python is awesome for what I needed to do (data manipulation) and would likely be my language of choice for such tasks in the future.
Also, the best way to get a highly commented article on HN is to write one on why you love, or hate Java.
Really? I have code from the late 90ies and it compiles just fine. Do you perhaps mean dependencies? Because the issue there is the completeness of the framework and libraries around Java rather than the language itself.
I once wrote an application in 2005 that kept running with unmodified source code up until 2017 in production across multiple operating system upgrades, database upgrades, and a transition from 32-bit to 64-bit runtimes.
I'm almost expecting a few years down the road, Microsoft will go back on 4.8 being end-of-the-line for .NET 4 and start releasing new minor versions of it because of all the customer code that can't be ported to .NET 5. Or maybe it will just end up like VB6. Stuff written in it still works, and will continue to work, but it's considered a dead language.
"Initially" would be somewhat closer to the truth than "always".
What the hell? I don't think we have the same definition for any of these words.
I know Java has changed quite a bit since Java 8 (Java 9 being the last version I used professionally before switching completely to Go), but I just can't write Java again, it's physical. When I want to try a new Java feature and think about writing the scaffolding code, my stomach actually hurts.
Not to mention the pain point that it still is to install and configure a JDK, and make it work properly with Intellij, why is it still so complicated?
Then there's Maven and Gradle that are just... bad, I have no other phrasing. I hear a lot of people saying Maven already solves all the problems we have with today's tools but that's just not true, even the entire Maven stupid lifecycle should be thrown away!
I used to work for a company that had about 100 different Java web applications running, each with their own JDK. It was _trivial_ to set up and maintain. Was it wasteful? Sure. I shipped a JDK with each application. Was it hard to automate? No. Basic deployment automation made it trivial. The JDK was just an application artifact alongside the JAR file, and the application starting script set JAVA_HOME pointing to it for that process.
IntelliJ makes it trivial to maintain a project specific JDK. You just add the location of your JDKs to it (IIRC it can even auto-populate the list), and then choose the JDK from a simple menu within the IDE.
I used to be a C++ wizard. I did things with that language that were just unspeakable. I used features so obscure that I don't even know if they have an official name.
Then after I dunno... the five hundredth nonsensical linker error, something in me just snapped and I just can't ever go back there.
IDEA can download and configure one of multiple JDK distributions in a single command:
I really do believe that the reason we have programmer holy wars is because we approach problem solving in different ways.
The way I approach solving a problem with a computer program is almost incompatible with the Java programming language. And, no- this is not a thinly veiled way to shit on object oriented programming. I can work in an object oriented paradigm just fine. It's just Java specifically that doesn't work for me.
Here are some examples that constantly bother me when writing Java:
* Null. Enough said.
* Writing value types used to be very tedious and bug-prone before Records. I haven't written Java with Records yet, but I'm glad to know that they'll be there if/when I do Java again. Even for an object-oriented architecture, value types can be useful and I use plenty of them.
* Type erased generics are painful. Especially with interfaces.
* The number and arithmetic APIs are incredibly frustrating. No unsigned numbers, silent wrap-around on overflow, silent data truncation on casts, etc. I have zero confidence that my Java code that deals with numbers is robust at all.
I'm sure that many programmers don't even notice these things, because they way they interact with program design is just different than my way. But when I write Java (or mostly any JVM language) one or more of these issues are on the forefront of my mind with almost every single line of code I type. It's almost unbearably frustrating.
"This cannot be understated: Java simply feels good to write"
But why?
The only explanation that follows is that "a lot of this is due to the craftsmanship JetBrains puts into IntelliJ IDEA. Everything is autocompleted, jump-to-definition is fast, find-usage works well, and refactoring is easy".
I too think that IDEA is an excellent IDE, but why should Java take the credit for it. If anything, the more it needs an excellent IDE in order to feel pleasant, the worse it says about the language itself.
It really looks to me like the "ignorant computer science undergrad" mainly worked with JavaScript (having only dabbled with C++ and a few other languages as part of his uni courses), and got excited by discovering a proper IDE and a statically typed language that happens to have a low entry threshold.
I've never seen a Java program in my entire career that was actually fast and not a huge pain to work with. I'm working on a new one right now and the prototype/skeleton literally does just basic CRUD operations and the CI/CD pipeline takes 7 minutes.
Golang was a breath of fresh air for me.
You can put it another way and say it doesn't feel good to write Java without JetBrains.
You just download the JDK, and set JAVA_HOME to point to it when you want to use it.
For IntelliJ, you set the JDK in the project settings. It has a menu where you can point it to a JDK it knows about already, a JDK on your FS, or you can select a JDK for it to download for you. Couldn't be easier.
Java build systems are mostly terrible - you're right about that. Maven has the best tooling support, and is actually very straightforward, but a bit limited. I have had a number of bad experiences with Gradle. The Blaze-family build systems (Bazel, Buck, Pants, Please, etc) are far more sane, but have low adoption.
Where’s the pain?
tar -xzvf <jdk archive>
<set JAVA_HOME env var to point to dir>
<add to PATH $JAVA_HOME/bin>
So complicated.
As for amounts of scaffolding, IntelliJ product writes it for you. And modern Java forces you to write only a half of it anyway.
Like, if you're out of work for a couple of months and the only way to feed your kids is to take a Java job, I don't think you'd pass it up. I wouldn't pass it up either even though I don't like Java. The whole language feels like it's designed to meet some minimum lines of code requirement.
If you're working on a team, strongly typed languages like Java and C sharp are a must. Otherwise it can get extremely hard to figure out what exactly other people are doing.
Other languages have other pains, for example I have physical revulsion against the version management hacks for python or ruby (rbenv and stuff like that - somehow hacking environment variables on the fly to manage multiple installations of the language).
Two years ago I wrote a small web app in Python and I found hosting very complicated, compared to Java. PaaS exist but are very expensive.
JVM is great. I think it gets a lot of love (in comparison with .NET Core which is IMHO as good as JVM). In this one, you see JVM everywhere except desktop apps.
Then, there's Java itself. As a language, it really isn't as modern and doesn't provide much what isn't already available in C#, Scala, Kotlin, or even PHP or TypeScript. And it doesn't provide some things that other languages have. So on this scale, once you know Java, you can be productive, but I doubt you will be more productive than someone who knows C#, Scala, etc.
And then, there's Java culture. Plenty of Java devs (mainly in J2EE, Spring world) don't develop in classes, they develop in design patterns. AbstractFactoryStrategy, complete abstracting out databases, five layer data models, classes for things that should be enums. It's a matter of taste, you don't have to do it (Android devs don't do this that much even when they use Java). And I think all the coolness of modelling, UML, etc. is over.
I think, you can be productive in Java (if you use it a bit like PHP). I think JVM is fantastic. For me, I am 8 years in Clojure world and I wouldn't go back to design patterns, writing (in Java often generating) dozens of lines of code just to insert something to the database (entity, mapping, repository, business logic layer, etc.) when in Clojure, this would be three lines (defn, schema check, insert).
I actually think the core language is great. And under Suns management Java was largely what golang is today; it was the pragmatic choice and it put the focus back onto writing code and away from complicated language features.
Then IBM stepped in with JEE, and it completely transformed Java into a language for bureaucrats and over-complicators. JEEs ethos was that the programmer is stupid and that the framework saves the programmer from their own stupidity. Not the greatest of ideas if you ask me.
Sane people jumped to newer languages. I tried to stick around and argue against bureaucracy, but in the end I realized the pointlessness of it all.
Now I'm ironically back with c++, but still the community is much purer and focusing much more on actual coding than snake oil.
Still write Java on my spare time and love it for it's relative ease of use, speed, and clarity. Not the most portable, ironically, but my language of choice for prototyping.
Java still has some true high quality libraries in it. I'm yet to find a good replacement for Doug Leas concurrency libraries in other languages. And the containers are great. And despite all the flak it gets, I actually think Swing is really good for whipping up a simple UI.
- The programs are very verbose for the functionality they provide. There are countless lines of getters, setters, and trivial constructors. While IDE helps to write them, it makes reading existing programs slow and frustrating. Lombok helps, but very few programs use it.
- If you do want to use Java ecosystem, there is Scala. It also has strong type system, nice IDE support and big ecosystem of third-party libraries, but is much more expressive and easier to read and write that Java.
- Finally, if you have to run medium to large java programs, you need to constantly tune the JVM. Unfortunately, you can't "confidently trust the JVM to do what's best" -- you need to get familiar with GC algorithms, manual heap sizing, GC tracing options and so on.
Java still has plenty of uses because it has so much code written in it, but luckily, the new projects are using it less and less. I really look forward to the day when I can stop tuning -Xmx option in start.sh files!
- IDE support for Scala is half as good as Java and I suspect a good reason is the language. The auotcomplete in intelliJ is almost as bad as it is for python and the IDE really struggles to understand the code; CPU usage when scala is open is MUCH higher than Java.
- On all the Java apps I've worked on, I've never tuned the JVM. Tuning the VM sounds like focusing on the wrong part of a bottlenecked system. I've never tuned Python or PHP either but they aren't as performant. Regardless, GC gets better every release.
It sounds like your negative views are more about the applications you've worked on than the language or technology.
That's true for 2005, not 2021, with var, type inference, closures, streams, and other such features. And since forever getters/setters are auto-generated by the IDE (including Emaca and Vim) and can just be ignored, and Java today has Records which don't need them.
>- If you do want to use Java ecosystem, there is Scala.
Now you have exponential problems. Scala has less support, slower builds, and features Scala-devs are eager to abuse to make the code unreadable.
>- Finally, if you have to run medium to large java programs, you need to constantly tune the JVM.
No, you really don't.
You either haven't used Scala, or you haven't used Java.
- It forces us to go through the ceremony and verbosity of static typing, yet blows away lots of the benefit by pervasive use of `null` and `Object`. Compare this to ML or Haskell, where there's less ceremony (Hindley-Milner type inference) yet more safety (no `null` or down-casting)
- Checked exceptions have a similar ceremony and verbosity problem, yet the pervasiveness of unchecked exceptions prevents us actually having much confidence that calls will succeed. Compare this to effect systems, even rudimentary ones like Haskell's (`Maybe`, `Either`, `IO`, etc.): if a function doesn't return one of these 'effect actions', we can be pretty sure that it will succeed (the only unchecked exceptions I've encountered in Haskell are pretty catastrophic things like OutOfMemory).
- It needs to be compiled ahead-of-time, which requires more tooling, makes automated testing more annoying (we have three different failure-reporting mechanisms: app compile error, test compile error, test failure), tools like REPLs are second-class afterthoughts, etc. Yet the resulting bytecode still requires an interpreter (JVM), which takes a while to spin up, and makes deployment and packaging harder (we don't have a self-contained binary).
- It pushes an OOP style, but requires that we keep subverting it; e.g. pervasive use of using structured-programming constructs like `for` (which other OO languages like Smalltalk avoid in favour of method calls), which requires we break encapsulation/implementation-hiding (e.g. if we loop with an 'Iterator', we need to know whether anything we call will use that same Iterator).
- It seemingly pushes a high-level, highly-abstracted design (methods calling other methods, classes maintaining their invariants, etc.); but then throws threading into the mix, which breaks things into such low-level pieces that even 'i++' needs to be thought of in terms of constituent parts (read, increment, write, return).
I agree that Scala's better (e.g. reducing a lot of the typing ceremony; making it easier to remain high-level/abstracted (e.g. encouraging 'map' and friends rather than effectful loops), etc.); it inherits some of Java's problems (and doesn't even flag checked exceptions!), but it's nice enough to tilt the balance in many cases.
Oracle owns Java.
This automatically puts Java on my list of tools I'd prefer to avoid for new serious projects. (Legacy projects; if it's working and it isn't an issue yet, maintenance.)
There are one or two knobs left but those are fundamental to GC technology and it's not even obvious they're bad to have. GC lets you trade off memory against CPU time in ways manual memory allocation does not. You can throw memory at your program and it'll run faster, or you can constrain it and it'll run slower, but that's not a decision the developer can always reasonably make. It's in some ways inherently an ops/deployment/end user thing.
Other GCd languages either:
1. Have knobs too (Go/.NET both have knobs), just usually not very good ones.
or
2. Are so slow (Ruby, Python) that GC tuning is really the least of your worries and they just don't expose it at all.
or
3. Are JavaScript, in which case everyone pretends that running a VM designed exclusively for laptops and mobile phones on the server isn't a giant waste of resources. V8 doesn't do GC tuning because its only real customer is web browsers where users can't do that, and heaps are small anyway.
Java ended up getting a totally unfair rap about GC because it actually was fast enough that GC performance mattered, and was interested in power users on the server where exposing knobs can make sense. Other competitors don't even try, but this doesn't make them better. After all, nothing stops you just ignoring the knobs and plenty of users do exactly that.
Scala has a whole slew of problems of it's own. IMHO, Kotlin is where all the Java refugees on the JVM continent are at.
Thankfully, Java ecosystem has learnt from other languages and frameworks and with Java 8 onwards has addressed some of major pain points For e.g. lambda, streams, vars, text blocks, records etc,
On the other hand, Shopify and Dropbox that used Ruby and Python heavily had to invest in type checking to bring back some sanity and this is evidence that beyond a size of code base, static type checking is worth it.
Considering these, I find Java to be a very good option to build stable enterprise applications compared to Ruby or Python.
Which is honestly why I think Typescript with Node on the backend is an excellent choice for many enterprises.
I make a point of starting all new projects with just the JDK, and taking that as far as possible before adding dependencies.
A 40k LOC codebase i work on has these external dependencies (plus some company- and vendor-specific libraries, which we would need in any language):
1. Netty, for serving HTTP
2. Glassfish JSON, for parsing and formatting JSON
3. FastUtil, for efficient collections of primitives
4. Guava, purely to get PairedStatsAccumulator
5. SimpleFlatMapper, to parse and format CSVs
No frameworks, no criminal bloat.
For the first few years of its life, this app used the JDK's own HTTP server, which was fine. Then we wanted to add websockets, so we needed a more sophisticated server.
If there is a problem with Java here, it's that people don't realise you don't need frameworks. A lot of developers will reach for Spring, Java EE, or something else like that right at the start of a project, without questioning the need for it. But this is not a failing of the language, or a problem you have to impose on yourself.
Actually, Java has great tooling, JVM is very nice, it has great potential for high performance code generation. It has everything for debugging. But at the end of the day, language is driving people to write bloated software.
I just wonder, how come e.g Linux kernel code 100 times more readable than any project in Java? More importantly, how did we come to this point that we accept bloated/unreadable code in the name of higher/better languages?
Ship functionality as libraries, not massive sets of "Thou shalt do it our way in our all-encompassing , over-complex, hard to debug straitjackets."
The language itself is not what it was, it's very capable.
I think this author is going to be up for a rude awakening when it comes to the benefits of nominal typing, as this is the area that I couldn't disagree with more. I've commented about this before, but structural typing in Typescript makes it so much easier to refactor and to get one existing piece of code to confirm to another existing piece of code. Refactor projects in Java could sometimes literally take months when you had a major version upgrade from some important dependency and now you had to replace all your Foo1 objects with Foo2 objects, even though the interfaces themselves were largely the same.
I just find myself sooooo much more productive in the Node/Typescript ecosystem than I ever felt in Java.
IMO Java and C# and other compiled languages have the opposite problem with languages like python and JavaScript (I love all these languages btw). It’s easy to get up and running quickly with the latter. It’s not until your project has grown in complexity when the formers value becomes apparent. This is similar to mongodb vs say, Postgres.
Also modern Java has picked up a lot of the better ideas from Kotlin and Scala. I still prefer Kotlin but I think a lot of criticism I read is referring to older versions of Java.
No, Java is just about as hyped as it needs to be. Which is to say, it's more or less fine. Not great, not terrible. Middle of the road at best.
I'm used to Python (and some Go) for decades, and the verbosity of Java is a non-issue to me.
I'd rather have the speed, type safety, and refactoring tools support, over Python... (not to mention the much better packaging situation).
I'd still prefer Python for smaller programs, basically because of the startup time and quick write/try cycle. But for larger stuff, I'm not so sold, and I've been doing them (in Python) for decades...
Saying this as someone who Java after Python and other languages.
Manual for loops? No generics?
It was simple, performed well (other than GUI and classloading sometimes took a minute) and was very portable. I even wrote some demos in it in the late nineties to show it can actually do 60 Hz realtime graphics.
Over time, the ecosystem got pretty strong. JVM improved and the performance got better. Life was good.
But something bothered me. Those crazy dependencies, how everything was overcomplicated. Perhaps JVM got too good at optimizing and monomorphizing abstractions away? You didn't have to pay performance penalty for complexity anymore!
Worse, all these layers of dependencies and abstractions made it nearly impossible to actually understand the whole system and figure out root causes for the issues other than by using arguably fairly mature and good tooling available.
All this made me puke. So I stopped coding in Java, maybe 2005 or so. Haven't looked back.
Nowadays I'm happy developing things where Java doesn't stand a chance. Kernel drivers, bare metal firmware, tricky low level stuff, vectorized high performance code. Things that just can't get bloated or they might not work at all.
I don't have strong feelings about JVM much anymore, as long as I don't have to touch it.
JVM's high power consumption bothers me though, we're wasting so many nuclear powerplants worth of power for pretty much nothing. Of course the same is true for many other high level languages.
Perhaps we should work on high level languages with low power consumption?
And frankly, you simply can’t write all the software in use in low level languages. Yeah, it is theoretically possible but not feasible
Heck, here were native Java CPUs, Java Smartcards and different editions like JavaME for what today is branded IoT devices.
I cannot get the "write once - run everywhere"-slogan out of my head to this day. I don't even want to imagine a world where Java Applets actually "won" the internet and we would have proprietary multimedia applets instead of <audio> and <video> tags or even just CSS...
The reason Java can be a nice language/runtime today is the sheer amount of resources available to be poured on it due to all the hype in the 90s. It was supposed to save us from all the effort porting our software to many operating systems and processor architectures (the computing world was much less homogeneous back then). It was supposed to run everywhere without modification, from the smallest smartcard to the biggest mainframe. It was supposed to not only run within our web browser, but also be the implementation language of our web browser, or even the whole operating system. It was supposed to magically be faster than even C and C++ (those who used Java back then can recall how slow it was; for instance, hanging the whole browser for a whole minute while the JVM started up was not uncommon). Everything was supposed be written in Java; it was not good enough to call a native library for whatever functionality you wanted, it had to be rewritten in pure Java.
Java was a mediocre language. All that hype led to a virtuous cycle, which allowed it to grow into what it is today.
But once you are through that painful process, there is no other ecosystem more stable than Java. Things don't move too fast and that's a good thing for production applications.
I do dislike the verbosity sometimes while doing something that would take just a few lines in python or ruby. But IntelliJ more than makes up for it.
IMO, if you want to get a descent job in a large company working on backend systems, you want to learn: Java, C/C++ or recently Go. You will be able to build pretty much anything, from a micro service to self driving car.
If you want to stick to startups, you can do well with anything else till it growth, experienced engineers are hired and rewrite it in one of those languages.
Nothing is exciting about it since it's so common. I personally dislike Java since I just find it hard , you'll never want for work as a skilled Java developer
This is nothing more than the ramblings of an inexperienced kid who thinks they know it all. He'll probably look back on this in a few years and realize how little he actually knew.
In Java, this overall approach manifests in myriad of different ways:
- Functions and data are tied together. It's difficult to create new functions (methods) that operate on existing data, you have to inherit, and even that avenue can be closed, even indirectly because you find that you cannot actually get to some internals.
- Interfaces are tied to objects. You cannot explain to the compiler that a given class actually supports a certain other interface in the way YOU define it.
- Everything is a reference, no value types. No need to worry about the intricacies of cache management, we will handle that for you.
- No need to worry about CPU optimizations or memory management either - we will do that for you, without an escape hatch.
- You cannot change the existing operators to introduce more convenient syntax, because I said so. Any kind of "macro" - code generators, compile-time checks, conditional compilation, DSLs - forbidden.
- The class and package hierarchy determines the access to its components. No way to override this from the outside, no way to expose things that are hidden. Worse, this is implicit, for example, class method accesses an object attribute, where taking a parameter would be more convenient; this hurts reusability pretty badly.
Some of these shortcoming are only now being addressed, because people actually need to do these things anyway, in certain situations, which leads to proliferation of patterns and magical code generators.
I think it’s made worse by the fact that you can program in another language, in a shitty codebase, and walk away saying “wow that language is very painful”.
When in reality, it could’ve been the codebase and not the language.
I see a lot of “but look at this successful project in language X”. Okay sure it was successful despite the language. Programmers are smart, we can make things work.
Philosophically forcing developers into having to program in an OOP style, as opposed to having it as one of many tools, is a cardinal sin in my eyes. Same for forcing reference types.
I’ll argue garbage collectors are bad too, but tbh that is more of a debatable topic.
Data classes that expose their internals are a great way for some program logic, but let’s say a database connection is very much not a simple data class. It does have some static data, but it should not be accessible to the outside, because then it is not safe to close/use/whatever.
Working with it as a dev, my opinion improved. A lot of the new FP inspired APIs make logic much terser, and the OOP stuff can make implementing certain architectural patterns very clean.
The other great thing about Java is that nearly every conceivable question has been answered, as far as day to day development. Not so for newer languages.
My biggest pain point with java is the type system. Like, you basically need to write or consume a library to work with tuples.
The points listed in the article for why Java is great apply to many of the workhorse languages in the industry today.
It’s also a natural consequence of TS explicitly choosing not to expose its type system to the runtime; a choice which confuses many, but makes sense given the potentially unpredictable performance impact that could have. But there are plenty of good tools for declaring validation and getting types “for free”, allowing you to choose explicitly where you want to incur that runtime cost—typically at API/network boundaries.
This is not much different from interface/protocol/contract based typing, which often appears in a goofy way in Java: class Foo implements IFoo. But when you work in an environment where interface typing is commonplace and done well, it really helps guide good modular design.
I have spent more time than I ought to have trying to find conforming types in TypeScript and Go code through trial and error. Fortunately I get feedback pretty quickly in my editor, but it is still a frustrating exercise. I want to build mechanisms, not solve jigsaw puzzles.
I work an an Android use case, so reading Java stacktraces, and code commits became a valuable skill.
Then, I learned the value of using Java libraries such as Appium and Selenium for end-to-end integration, performance, and reliability testing.
Then I started using Java libraries like Okhttp, Jackson to build fancier test setups.
While this was happening, I was learning the value of writing code that could be ran in containers - which Java does. Now I can create microservices that I stick in containers on Google Cloud Run or Pivotal Cloud Foundry - and pass arguments to execute tasks.
After getting these foundational skills developed, I started working on adding features to Android apps in the use case.
Since I had learned that much, I figured I should write a personal site using Spring MVC, Spring JPA, VueJS, ChartJS, and CockroachCloud (postgres). I then went and wrote a DAO microservice to write to CockroachCloud on a recurring schedule, and used Java with JDBC to learn how to access postgres without Spring.
Java has become a great skill, that I picked up almost entirely during the pandemic. Especially when paired with Javascript. On Javascript, what I find interesting is that some teams have rewrote services from Javascript to Java. IME, Java works on everything, and with everything.
Once you master one object oriented language, having to learn Objective-C or another variant of Java like Kotlin or Scala becomes that much easier.
IMO, there are 3 things are worth learning. They are SQL, a high level scripting language, and a object oriented language. They all have their uses, and the skills are transferable. For me, Java just happened to be the most valuable skill I could learn.
A few years passed and I got to program in Java in a commercial environment. It was J2EE 1.4.
It was bloated, had a really heavyweight and crappy ORM (JavaBeans? Active Beans?). As a framework it sucked. Also it was boring business applications, the cool kids used Python at that time.
Just my personal snapshot of how Java lost the hype for me - crappy "dozens of layers" framework and an unappealing niche.
In one job, i used an enterprise framework that actually predated Java EE. Several ideas in EE were copied from it. But incredibly, this framework was substantially better than early EE. I believe, because that framework was built by people who actually needed to ship products to customers to pay their bills, which limited the amount of overcomplication and obstruction they could get away with. There was no such limit on Sun's architects.
Given their insidious licensing and litigious nature, I wouldn’t touch Java with a ten meter pole.
theamk's post about
> There are a few reasons to avoid Java today.
Hard agree, and had the same thought BECAUSE Oracle.
I work on a codebase with hundreds of thousands of lines that haven't been touched in 15 years. We're on Java 11 with plans to update to 17 later this year. Our 8->11 upgrade took me 3 days on a million+ line codebase. And when we released there were zero bugs related to the upgrade.
Java has the stability keep projects maintainable over decades. The only mainstream language with comparable backwards compatibility is C.
However, it's the culture around Java that I hate, and that's the reason I avoid Java. The amount of low quality Java code out there is staggering. The culture around Java is one of extreme levels of abstraction and encapsulation, and it makes reasoning about Java code really painful some times. If you have worked in a Java shop, check out the Enterprise edition of FizzBuzz: https://github.com/EnterpriseQualityCoding/FizzBuzzEnterpris...
I've had to work with Java professionally for a number of projects over the years, and honestly the only use for it I've actually agreed with as "good" is on Android -- and as we know, Google tweaked it, battles ensued, yadda yadda ...and even they are moving away from it.
The shitshow that owns it is good enough to avoid it, let alone the language itself.
We will never see its like. There's no money in programming languages anymore, no one would drop the kind of cash on pushing their pet language that Sun did back in the day.
What I'm saying is: Java have had its hype and should settle in for a dignified middle age rather than try to hang with the cool kids.
- debugging environment
- memory and CPU profilers
- compilation and linting time of 100k+ codebases
- IDE support for 100k+ codebases
- static analysis & software architecture metric tooling (complexity, dependency analysis etc.)
- inherent scalability of the language, maturity of patterns & practices of scalability
"Dependency heavy workloads and industry trends"
The author complains about JS having small packages about trivial things (and for some reason when people talk about this they always mention lpad, apparently lpad is the only small package in NPM /s).
And about the fact Java has a type system. Many languages have a type system. In fact JS also has a type system through TypeScript.
"Nominal typing"
TypeScript typeguards are compared with the lack of Java typeguards.
- Java has typeguards and they're even being extended: https://openjdk.java.net/jeps/394
- Type guards have nothing to do with nominal vs. structural typing. They're rather used to disambiguate unions. If you have no unions you need no type guards.
- Interfaces in TS are structural, but classes are nominal. Typeguards can be either.
"Removal of responsibility for optimization"
The author believes Java frees them from memory management and multithreading race conditions, and the need to optimize (like think about underlying data structures, algorithms etc.).
Java reduces memory management concern relative to C++, but you still have reference leaks, you still need to free resources like file handles, connections etc. Also Java is no different than JS, C#, Python, etc. in that regard.
Java DOES NOT prevent race conditions.
Java DOES NOT mean you don't have to optimize.
-------------
All in all this reads a bit like a JS developer who just discovered Java and is excited. That's good, but my conclusion is Java isn't underhyped. Or overhyped. It's hyped just about as much as it needs to be.
Is this true? I might be missing something, but this snippet to me suggests otherwise[0].
[0]: https://www.typescriptlang.org/play?#code/MYGwhgzhAECyCeBhcV...
>by crystallizing type definitions and guaranteeing type guards by default.
Not so crystallizing if you know.. if you've ever used a Java List, Set or a Map. i.e., List<icouldbeanythinginhere>. such guarantee. wow.
Honestly, I'd prefer TS with strict mode over Java any day because nullability is explicit, don't have to watch out for the dreaded NullPointerExceptions left and right.
I would just recommend learning another programming language :)
(I'm not affiliated - just someone coming back to Java after 20+ years of C++ and Python).
Recent stuff includes:
* Vector API
* Record classes
* JDK Flightrecorder
* Java 16
Having 100% is just as not enough because you can arrive at a line of code from exponentially many states. Mutation testing is a good way to show whether the tests are actually worth anything.
Also, congrats on graduating from CU! Just graduated last semester.
Newcomers get no real guidance on what to do. What do you install? It can be any of a number of different vendors. How do you deploy? The official documentation hasn't been updated since Java 8: https://docs.oracle.com/javase/tutorial/deployment/index.htm.... It still mentions applets! (Which are going to be removed soon.) IMO, all projects should be using jlink and shipping a slim runtime they've used to test against (https://docs.oracle.com/en/java/javase/11/tools/jlink.html). There's basically zero documentation on how to use this for non-modular applications, and you have to find and apply non-official plugins to get that work done. I continue to see most deployments using the entire JDK which, honestly, has been unnecessary for three years.
Nobody really knows what they mean with "OpenJDK". They might be talking about some distribution based on the source code. Or, they might be talking about a download from jdk.java.net. Or they might be talking about installations from Azul, Microsoft, AWS, or any number of ad-hoc vendors because the name is unlicensed. This is a big deal, because I've had team matest install "OpenJDK" and actually end up with ad-hoc builds that weren't tested, and had random bugs.
Professionally, I've ended up having to deal with fixing landmines because Java devs tend to not learn the intricacies of their frameworks as well.
The technology is still going strong, and is moving faster since the modularization. Loom (https://blogs.oracle.com/javamagazine/going-inside-javas-pro...) will be a big deal... but I wonder, will most devs practically understand how to take advantage of it?
I'm actually old enough that Java was my main language during CS. No Python...
Before that when I during my teenage years I got to lecture by some senior in IBM that showed how amazing is Java and it's the future. (That was 10! Years before I've attended)
And that's that's the thing... Hype is all about "new" things. And after a while it dusts off.
HN had a lot of posts about good developers. usually it sums up as problem solving and human relationship. Never I saw a good developer of language N.
Is java considered old or outdated for today in CS? I'm learning Java in my AP computer science class to this day.
It even did deliver at the beginning, but then it stagnated.
Now, it's just bloated. The syntax, the programming model, the package manager, the runtime. If you look at systems like Eclipse and Jenkins, even the software developed with it seems to go that way.
Kotlin should have called itself Java++ imho, that would help adoption in enterprise where managers might not know difference with Java
I feel like the takeaway the author should have arrived at is that hype comes and goes, and doesn't really correlate with whether a piece of technology is valuable or not.
It's following the hype that steered him wrong in the first place.
Over time, I've found myself more interested in tech that sticks around. There's usually something to learn from it.
I totally agree that Java is not bad (also chatted with some friends about IntelliJ etc.), but as many have pointed out, it simply has a lot of weird tradeoffs that are already baked into the language. I always say that maybe in a few years I'd just say screw it and go write Java for a big corp. But for now I'd still like to enjoy writing Elixir with similar-minded folks as much as I can. Nothing compares to it in terms of developer experience yet. Maybe it's a form of meaningless stubbornness/resistance idk.
There's Kotlin (better than Java but not by a big margin), Typescript, anything else?
And I've heard good things about Dlang but I've never used it myself, I'll have to check it out some more.
I personally find the Java language cumbersome and the type system constraining. These days my preferred languages are Python, Go, and C. In my experience, Java is not a good choice for exploratory programming where adapting old code to new use takes significant repurposing effort.
- Maven
- Gradle
- Weak type systems
- 1 class per file and other dogma that leads to a million tiny pieces of spaghetti (cough GoF)
- java version hell
- garbage collection tuning (yes at scale its necessary and no I don't want to make more grafana dashboards of our application's gc and whatever open-source datastore we are using's gc since they thought it was smart to write in java)
- verbosity to the max
- people convinced none of the points are problems and that they are actually features. Its one thing to deny my pain it is another thing entirely to say its a "good" pain.
Setup jbang and install java if needed:
curl -Ls https://sh.jbang.dev | bash -s - app setup jbang
Create a java file that has dependency on picocli and just runs:
jbang init -t cli hello.java
Run it: ./hello.java
Edit it in vscodium with live fetching of dependencies(you can use your own ide too): jbang edit --open --live hello.java
Java is one of the most unpleasurable technologies to work with. It is slow to start up, full of idiosyncrasies, and all in all, a pretty awful language when it comes to brevity. Java is the epitome of "lets use this language so we can hire cheap coders." It is a vestige of what it came from, even if some new features have been added 10 years too late.
There were a lot of complications(students hadn't learned java previously), and it took some understanding of what the JVM was doing, vs c/c++ where pointers made it very clear what was happening. This was also in very early days of java, just at the beginning of JIT and hotspot.
I haven't worked on a big Java project in a few years, but I would always find myself missing stuff from C#.
Many years ago I discovered that I could use all the Java components just like that: https://speakerdeck.com/brutuscat/jruby-experiences
1. it is battle tested, stable, and its strong and weak sides have been pretty much studies and internalized by developers
2. Java devs are like sand on the beach. They can be found everywhere at a cheap price. Develop something, then slowly outsource/offshore dev to cut costs and continue milking sales contracts.
I depend on some ancient Java libs and they still work just fine. It's a huge relief when major version bumps don't break everything.
There’s no GC’ed VM that competes with it still, compatibility is taken seriously and what build systems + Docker try to solve now with a lot of moving parts was solved years ago with uberjars.
I don't use it day-to-day in my work anymore, but the principles I learnt were definitely useful!
Cross platform support used to be the trump for Java, but DotNetCore/5 works on Linux and has nearly everything ported over now.
The issue with Java is that you need an IDE for it to be usable. That's not an argument for Java itself.
This kid's going to the moon.
I think it really fell out of favor due to Oracle's litigious handling of it. As soon as Oracle bought it I remember people actually cancelling Java projects and changing languages.
Another problem is how complex and verbose it got. Original late-90s Java was pretty clean but eventually the ecosystem fell in love with enterprise style cruft and overengineered everything. It's less a problem with the language than the community though. Like C++, you do not have to use every pattern and language feature... but many people think you do and write ridiculously complicated verbose code.
Except that if you actually code for money, neither of those have many jobs available. Heck, in many cities I've looked _any_ jobs available. Java is still one of the most employable tools out there simply because it has a lot of jobs. Sometimes the hype-train of HN makes me think that people here are just coding for a hobby or their own start-up and entirely forget how the real world actually works.
Thanks for the info. Didn’t know this. I use AdoptOpenJDK and am grateful the free version is so fully featured.
I’d imagine back in the day Oracle Java reigned supreme and their licensing terms were a real concern.
It's not fast, not specialized, but is completely adequate for almost all use cases.
A mini-van is incredibly boring, but that's also it's best selling point.
Oh if only that was true. Sadly it's probably one of the most popular languages in undergrad courses around the world.
The API's are comprehensive, well thought through, to this day it's bizarre nobody has copied Javadoc. Python docs drive me mad.
For a script - Python. For the web Typescript. For low level C or Rust.
But Java is quite powerful for anything that stretches in between: not the fastest to write, but generally fast, the tooling is robust, the performance is quite good usually.
And I love that it's uncool.
JavaDoc-style structured documentation in comments with toolchain to generate user docs from a combination of the comments and the associated class/method/function signatures has been widely applied; Doxygen and JSDoc obviously owe a lot to it, as do Sandcastle (for .NET), Rdoc/YARD for Ruby, Sphinx/autodoc (for Python), etc.
I’d be surprised if there is a major language today for whuch there isn’t at least one JavaDoc-inspired documentation generator.
I don't know about the language itself but as an ecosystem Java failed spectacularly. Why is there a strong relationship between an application developed in Java and lack/horrible setup of documentation for this app? I just find it everytime I use something developed in Java.
java -jar application.war
Is as elegant as: v=irReminds me of a rationalization I heard once about how people pick their brand of cigarettes. They all taste like crap until you're finally addicted, then the one you happen to smoke at the time is now your brand.
Every new language / stack now gets compared to Java with IntelliJ because that's what they learned. Can't tell 'em any different.
I think my emotions are misplaced: I might just like IntelliJ.
Sure, java has its place and enables fine productivity in enterprise dependent workloads & scale; but that scale's complexity is often nominal, because what's unique about a traditional java-based system? Why would you use Java to be unique... the jvm is perfectly magical? nah.
Don't generalize engineering, lol, "feels good"... I think you mean "personally comfortable" which is what the oracles and jet-brains want you to feel. There is no art in java.
I'd struggle to invest so deeply or engrain myself in an enterprise setup vs whatever personal/business circumstances Id be in that situation. If you really want to be hip in that type of world go .NET
Java was designed by people who had absolutely no intention or desire to ever use it. They cribbed parts from other languages they didn't really understand, and changed details in ways that make no sense on their own, or with other things they changed for actual reasons.
Their estimation of its expected users was very low, so they made everything dull and squishy so nobody could do much harm whether by mistake or deliberately.
It got billions of dollars more hype than it deserved on merit. Its privileged place in the corporate world, like its good tooling support, are direct products of that hype. The hype it got on first release, beyond the (very large amount of) money backing it, comes from a peculiar twist of history: right then, millions of programmers were sharecropping on Microsoft's plantation, and saw Java as their 40 acres and a mule. It was a balky mule, but it promised freedom from switching to a whole new app framework literally every 2nd year.
Since then, a very large number of libraries have been made to package most common operations. It's barely adequate for making libraries, but people have put a great deal of effort in because of the big user base.
"I enjoyed programming in Java, and being relieved of the responsibility for producing a quality product.":