13 ms·
My first exposure to programming, the AP CS exam (and its accompanying course), was in java. My first hobby foray into programming (Minecraft) was Java. So, I'm
by ye-olde-sysrq 4y ago
My first exposure to programming, the AP CS exam (and its accompanying course), was in java. My first hobby foray into programming (Minecraft) was Java. So, I'm heavily biased here by my familiarity. However, in the years since, I've done a lot of time where my primary focus at jobs was, among others: python data stuff, "fullstack" stuff, Scala stuff, and golang stuff. And I just keep coming back to Java as my overall favorite.
My personal diff against most languages goes something like:
1. Stuff rots a lot less fast than in python and js. Code keeps working for longer, dependency goofiness happens a lot less, etc.
2. It's just less clunky than golang - but this is mostly my own preferences. I often describe go as if someone designed a language, and then had this list of hard language design problems, and were I to look at this list, I would go "hmm yes these are hard problems where all the options have drawbacks", and then for EVERY SINGLE ONE OF THEM they picked the compromise I would not have picked. So it's just death by a thousand little things that annoy me. My current job is golang though so I'm wondering if I'll come around to it or something. We shall see.
3. Java just doesn't encourage such terrible cleverness that Scala (and to a lesser extent python and js) invites. This might be cultural too where Scala has this functional programming fanatics segment who love the cats library a little too much. But never have I ever before seen so much code that's just intractable to junior devs, and requires far too much brain-CPU for mids and seniors to read. Sure you can get into a lot of trouble with Java's reflection, but IME many java devs are suitably reluctant to go reflection crazy.
4. Damn is it fast by default. And can be REALLY fast if you specifically focus on a specific path.
5. The tooling is so mature. Does python or go even have anything like VisualVM? And as I understand it, even VisualVM is old hat compared to JFR, though I've not looked closely there.
6. The library ecosystem. It's even more expansive then npm but 10x less thrashy and churny. I particularly like that there's this interesting niche of academic libraries that end up out there that you might find yourself bumping into now and then.
7. Packaging. People use maven. Even people who use gradle still basically are just using maven with extra steps. Sure it's XML but aside from adding dependencies, you hardly touch it. And if your build system truly needs to be weird (like, say, android), then gradle is right there for you. 2 tools for the whole ecosystem. How many does python have again? I find I have little patience for packaging problems and I suspect some of it stems from the fact that if I were using Java, I wouldn't be having packaging problems.
I'm sure I could go on, but I'll cut it here. For a million reasons, I find stuff built in Java just works and keeps working (both dev-environment and in prod) far more probably and for longer than in other languages and stacks. And it's fast enough to develop that I'd say it's well within range of python and ruby and such, for anything that bigger than a couple files.
- speed_spread 4y agoIf your build system requires more than what Maven can do, I'd say it's time to go home and rethink your life choices. All that Gradle does is allow you to create an unfixable spaghetti mess. Adapt your project to Maven, write your own plugins and extensions if you must. Don't. Use. Gradle.
- circuit10 4y agoAs someone who mostly does small hobby projects I do really like how easy the packaging is in Python and JS is. To get started you literally just do “npm i” or “pip install” whereas Maven and Gradle are a bit of a pain to configure in comparison
- carimura 4y agoTrue but beyond hobby projects this becomes a double-edged sword that swings back at you.
- circuit10 4y agoCould it not have both? Can’t something work like Maven or Gradle but have some nice utility commands to make installing things easy? Or does that already exist?
- mike_hearn 4y agoIntelliJ has a dependency browser GUI that can edit your Maven/Gradle builds, but yes you're right, the CLI tooling from other ecosystems is nicer. Unfortunately the lack of robustness isn't. Just today I was debugging a sudden failure of a Python script because someone released a new version of a dependency of a dependency of a dependency which for some reason just fails to install on Ubuntu 20 without a proper error message. In the JVM world there's no such thing as a failure to install a library, because there's no install process at all, and you don't need lockfiles or any of these other hacks to avoid stuff breaking.
- twic 4y ago