Live data from Hacker News

Java is still worth learning

empatheticdeveloper.wordpress.com

51–60 of 82 posts

Re: Java is still worth learning

#51
post #47
post #37

Earlier quoted context omitted.

may be it was the way you were taught java. It had abstractions but you were never forced to use them. Ditto with design patterns - you could use them, but none were forced, unless you _had_ to use a framework (like spring), but that's a choice! May be it wasn't your choice, but it was a choice someone made. If you used java like you used C, java is much easier and less mentally demanding, and therefore less prone to…

> Ditto with design patterns - you could use them, but none were forced, unless you _had_ to use a framework (like spring), but that's a choice! May be it wasn't your choice, but it was a choice someone made. Every language has a koolaid aspect to it. Java drinks the OOP+design patterns koolaid, so it was standard to use it incessantly. Yeah in theory there is a choice, not really in practice though. I find the typic…

> Yeah in theory there is a choice, not really in practice though. I find the typical over abstracted java codebase revolting.

It has gone extremely out of fashion to try to use abstractions over abstractions in Java the past 10-ish years. It used to be The Thing to do in the early 2000s, over time people got fed up with such obtuse way of programming, everything hidden under abstractions of abstractions, fucking nightmare.

Of course, there are still large remnants of this era, and folks who were trained in this still trying to apply the same bullshit design patterns to overcomplicate simple stuff, but in my experience it's been a pretty big shift away from that to more readable and simple code.

I still dread the years I worked in Java codebases with their factories of factories, registries of delegates, all the JEE bullshit, and extremely glad I haven't had to deal with this kind of stuff for at least the past 10 years or so...

Re: Java is still worth learning

#52
post #42

Earlier quoted context omitted.

Technically speaking, what’s the difference between native binary requiring some set of OS APIs or portable binary requiring a VM layer on top of OS? User experience can be the same, you can run those things from command line, pipe inputs and outputs etc.

the difference might be expectations that the OS api exists and does not require an installation pre-execution of the binary. On the other hand, i think the jvm, like python, ought to be part of a standard install of an OS tbh. Then there would really be no difference.

You can package a JVM into a binary executable, no need for a system JVM that way.

Re: Java is still worth learning

#53
post #14

The further away you are from VC money, the more "boring" technologies like Java make sense. Whole careers have been built on producing CRUD web applications with Java on the backend and Angular on the frontend. It's not exciting, but so is life without income in countries where this line of work is something to aspire to. I should know, as I live in such a country.

I refuse to jump on this oh-so-popular bandwagon of (seemingly) everybody complaining how java is uncool ad nauseum. You can make cool stuff in literally any language, and syntactic sugar around and how to express it are details. That's junior dev thinking, chasing fads, repeating others and not forming one's own opinions. This is mine.

Re: Java is still worth learning

#54

I’ve in university and the classes have been almost exclusively taught in Java. Learning C/C++ definitely felt like a step backwards, as there’s more you have to implement yourself instead of using the standard library. With that said, I think I learnt a lot more about how systems work under the hood by learning C, so perhaps it’s not as good for learning programming concepts IMO

This is why whenever someone asks me what language they should learn first (if they want to be a professional and not just a hobbyist), I say C. Don't learn a high level language first. Learning Java before C is like learning to ride a bicycle before you learn to walk. You will need to learn C eventually, but learning C once you already have a high level language under your belt will make the experience frustrating.…

I agree, I’ve definitely had a lot of “ahh, that’s why it does that/works that way in Java” when learning C

Re: Java is still worth learning

#55

I don't know. I started my career as a Java dev, but what made me grow as a software developer was learning Scala. I learned a lot about functional programming, algebraic data types, effects, and so on. I'd say Java is a great production language, mostly because it's so simple that I don't need to "learn" it (when you know better than using madness like `==` or Serializable).

I went the same route and am still working as a Scala dev. However Scala adoption seems to slowly go down, unfortunately .. Which is a shame because it's a beautiful language and I love using it as FP together with Cats. However Java has advantages too: the IDE support was miles better than Scala, build times were shorter, most frameworks were more mature and better supported and the language itself was much more sta…

Scala adoption is going down because it's a behemoth of a language with so many features that it takes too long to learn and be proficient with it.

There's beauty in simplicity, and Scala is the antithesis of that, it has not only the kitchen sink but the whole kitchen and some house attachments within it. I fell in love with Scala for a while, worked with it for a couple years, and absolutely hated it whenever I had to train someone new. Nowadays I simply refuse to work with it because I'm not willing to relearn all the stuff it needs to be productive.

Re: Java is still worth learning

#56

Earlier quoted context omitted.

I think you might need to look into java (or better kotlin) then. Is gradle not a package manager on top of a build system, just like npm? Is a fatjar/shadowjar not a "single binary"?

Granted this was years ago when I was a noob. I could not figure it out. But these days I can simply do `cargo test`, `cargo run`, and `cargo add`. I looked up what fat jar is and found this: https://stackoverflow.com/a/36539885 Seriously? This XML reminds me of the issues that I had when I first started Java, what the hell does any of these mean (yes, yes, RTFM) but then I could also just use another language and be…

Again, that's why you should have a look. You're badly misinformed. No need for XML or maven. You can just run ./gradlew test and stuff like that.

Re: Java is still worth learning

#57

If Java can be compiled into a single binary and have a package manager then I would learn it. I really want to like Java, or JVM-based languages specifically, but its extremely annoying and complicated to figure out how and why thing works.

Java can be compiled into a single binary. You can use for instance Graal VM for that: https://www.graalvm.org/latest/reference-manual/native-image... Java has Maven and Gradle that serve as package managers. I'd say they are not any more complex than npm, except if you need complexity to do something very specific.

You don’t even need GraalVM. Use jlink (part of the JDK) to create a JVM runtime with only the parts of it that you use, specially if you use the module system. Then you distribute your app as a binary basically, plus the resources it needs (the class files and images/text/etc files). I prefer that to using Graal because very often using Graal requires specifying extra metadata and behavior may differ from what you test, not to mention the atrocious compilation times and its lack of a JIT which means it may start faster, but peak performance is very likely lower.

Re: Java is still worth learning

#58
post #36

I don't know. I started my career as a Java dev, but what made me grow as a software developer was learning Scala. I learned a lot about functional programming, algebraic data types, effects, and so on. I'd say Java is a great production language, mostly because it's so simple that I don't need to "learn" it (when you know better than using madness like `==` or Serializable).

I get the point you're trying to make, but there's something ironic about touting a language as "simple" immediately followed by mentioning that using the basic equality operator that's used by pretty much every other mainstream language is "madness". I know every language has warts, but that one is pretty egregious both in terms of how quickly people would run into it for the first time and how easily it could have…

Fair criticism, but it's not really a practical problem. Usually a linter will catch them easily, and even when junior devs ignore the warnings, you can just tell them to use "equals."

The thing is that, equality is the difficult problem. "equals" in JVM languages has a lot of problems. Dynamic languages are much more horrible in this aspect. JavaScript `==` is much worse than Java. Python is guilty too in my view, for using `__eq__` method. The only language I know which solves the problem correctly is Haskell. (Or, `Eq` in Cats)

Re: Java is still worth learning

#59

I’ve in university and the classes have been almost exclusively taught in Java. Learning C/C++ definitely felt like a step backwards, as there’s more you have to implement yourself instead of using the standard library. With that said, I think I learnt a lot more about how systems work under the hood by learning C, so perhaps it’s not as good for learning programming concepts IMO

This is why whenever someone asks me what language they should learn first (if they want to be a professional and not just a hobbyist), I say C. Don't learn a high level language first. Learning Java before C is like learning to ride a bicycle before you learn to walk. You will need to learn C eventually, but learning C once you already have a high level language under your belt will make the experience frustrating.…

In C you program the C Abstract Machine, this machine is a child's drawing of the Digital computers on which C was invented, it's simpler and easier to grasp than they actually were but fundamentally similar. Your computer today does not much resemble this, but your computer is the real machine your software will be executed on anyway. Mistaking the Abstract Machine for your real one is a catastrophic misunderstanding and C feels as though this is the bare metal when it is not.

As a result it's more honest to use a language where it doesn't feel as though you're touching the bare metal, because you aren't anyway†

When I last checked both Oxford and Cambridge teach an ML as First Language. So did the place where I did my degree decades ago although today it teaches Python (which I believe is a mistake). That's because the theory of computation is foundational here, not the practice.

† Even assembler isn't touching the bare metal, you have features like out-of-order execution and register renaming between the machine code you wrote and the actual things done.

Re: Java is still worth learning

#60
I've been hating Java since 1999 for many reasons, yet I'm a Java Developer since then (with episodes of Python, C, C++ and Qt). The language itself got on my bad side when the Java developers said that they will not implement operator overloading (I'm a little bit crazy about the subject) because - EKHM - it would allow writing unclear code, which is bananas.

Things missing in Java:

  - .? operator
  - operator overloading
And there were a lot more, but most of them are already solved. The language is tidy and usable, the Optional api is not bad, the native function calling is improving.

But what I wanted really say is: the language itself is one thing, but the libraries available are the other. The strongest libraries in Java are the part of the language, especially time handling, character encoding, etc. Java was built with utf-16 in mind and other languages are still trying to cope with it. There are frameworks (outside the language standard) which allow crazy fast web service and DB development. It's all good, it's all standard and it's rarely breaking the backward compatibility. So you get a new developer, just after CS Bachelor and they jump into the project and understand the huge part of it.

When I'm learning new languages, I tend to try writing business applications and usually I cope with the same problems: datetime, string encoding, database connecting, etc. Yeah, golang has great goroutines, but they still import web service library from some guy's github, which can vanish in no time.

Post reply on HN