My public writing. You can reach me at @eitland@mstdn.io

Questions about why I like Java

Filed under #java and #dotnet

I got a couple of questions about Java, the answers became so long I decided I could rather post them here.

As usual everything here is a draft, otherwise I wouldn't have time to finish it.

(Questions modified to fit the format.)

Why did Java become your favorite language even if you didn't like it from the beginning?

About ten years ago I worked simultaneously on Java and Delphi and PHP and had some experience with Javascript (coded a map viewer in JS and SVG) as well as a little bit C from school etc.

This was just at the time when Maven became popular and our tech lead introduced it despite some unhappy sounds from our boss.

At that time we lost days of work (and used a top consultant for three days) first hunting dependencies for Delphi then having to install them in the right order and with the correct incantations in between.

I also had plenty experience with hunting for typos in Javascript and PHP. Remember this was 10 years ago, long before Babel, Typescript, linters and what not.

Java on the other hand just worked. No squiggly line meant it would compile. Hunting for and manually updating dependencies became a thing of the past as we introduced Maven, and even with Ant it was OK compared to the mess that was depencies in e.g. Delphi.

The difference in ergonomics when coding was also day and night. With Java and a good IDE typing was reduced, typos were gone, all information you want would be available reasonably quickly (even if this was back in the days of spinning disks), and the refactoring story of Java was one of a kind back then and second to none even today IMO.

The last thing I disliked about Java was the insistence on xml heavy frameworks as well as the fact that the setup we used at that place took two minutes to restart and had to be restarted for code changes to take effect.

At that time though I started to rely on automated tests for business logic which cut down on server restarts and I also learned to use the debugger in my IDE which meant I could finish troubleshooting without restarting the server.

And why only for a decade?

I still like it a lot. It is still my favorite ecosystem. All the xml is gone now from all mainstream frameworks. And I sometimes miss Java features and editor features even when I program in C#. And yes, I too liked Java even better after Java 8.

Meanwhile I can now program C# without selling my soul ;–) Both dotnet and VS Code works extremely well on Linux, has a less ugly company to back it and has had the benefit of learning from the extremely successful business language that is Java to make an even better language.