Live data from Hacker News

Java is still worth learning

empatheticdeveloper.wordpress.com

41–50 of 82 posts

Re: Java is still worth learning

#41

I’ve been working as a backend developer for close to six years now, but reading this brought me right back to college. Like many others, I started with C. It taught me the basics - memory, pointers, writing data structures from scratch - but most of the time it felt like I was just trying not to break things. Solving problems became more about handling the language than understanding the logic. Then I came across Ja…

Similar story - did half the university courses in C or C++, then picked up this new language called Java for next semestral project. I made 3D map of my home country from a set of 3D points in something called Java3D, long-abandoned effort that could make 3D objects and interactions ie in desktop UI but also on web via applets (I told ya long time ago, this was early 21st century).

Working under it, apart from usual initial pains was marvelous - the language itself somehow forced me to make much cleaner code compared to C, which as a beginner became horrible mess pretty quickly. Suffice to say, debugging was trivial, no pointers just easy life.

25 years later, Its close to 100% of all work I ever done professionally and I don't mind surfing that wave till retirement, Java is so spread into corporate sphere that there will be enough work especially for seasoned experts for decades to come.

Stuff juniors often complain - OO bloat, EE megabloat etc become invisible pretty quickly, and you just work with the code, however you like it. Its a great platform to see that premature optimization is really not something to worry about during initial implementation (unless you do N-th rewrite of some performance-critical app, which most of us rarely if ever do). It doesn't mean any spaghetti code is fine, just that following normal design principles is normally good enough and one can focus on things like security, clustering and actual features.

Re: Java is still worth learning

#42

Earlier quoted context omitted.

> Is a fatjar/shadowjar not a "single binary"? No, it isn't. `go build` is a single binary.

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.

Re: Java is still worth learning

#43

The content of this post makes some sense, however it does look like it’s written by AI and thus lacks depth, context and personal touch.

Especially sentences like these: "This wasn’t just about type safety – it was about reducing the mental burden of programming." The "x wasn't just about n — it was about m" carry a strong LLM smell.

Another giveaway:

> Whether you’re debugging your first NullPointerException or architecting enterprise systems, there’s always someone willing to help you grow.

> Whether you’re starting your programming journey or looking to add a robust, reliable language to your toolkit, Java remains one of the best investments you can make in your technical future.

I wish people would be more thoughtful about how they used LLMs.

Re: Java is still worth learning

#44
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

Re: Java is still worth learning

#45

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…

Fun fact - cargo, npm and other package managers for programming languages were inspired by java maven.

Java is still using maven architecture (even if you use gradle to interact with them).

I'd argue Java was the first language to get dependency management right - you have 1 place you put all your dependencies - globally uniquely identified and versioned, downloading and building them is automated. It's especially jarring when you compare to the chaos in C++ land.

Re: Java is still worth learning

#46

I’ve been working as a backend developer for close to six years now, but reading this brought me right back to college. Like many others, I started with C. It taught me the basics - memory, pointers, writing data structures from scratch - but most of the time it felt like I was just trying not to break things. Solving problems became more about handling the language than understanding the logic. Then I came across Ja…

> Solving problems became more about handling the language than understanding the logic. I've worked with Java for 25 years and have a love/hate relationship. Java garbage collection is both great, and terrible. Sometimes objects are instantiated in a method, and should be marked for GC when you leave the method but aren't. There isn't logic or reason, and it trips up juniors hard and reworking "new" features like st…

> Sometimes objects are instantiated in a method, and should be marked for GC when you leave the method but aren't.

Can you give more details, and/or an example?

Re: Java is still worth learning

#47
post #37
post #29

Earlier quoted context omitted.

Funny I had the exact opposite reaction to Java when I needed to use it in college. So many abstractions, forced design patterns and boilerplate. Absolute soul sucking joyless development.

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 typical over abstracted, one line functions everywhere java codebase revolting.

Re: Java is still worth learning

#48

I’ve been working as a backend developer for close to six years now, but reading this brought me right back to college. Like many others, I started with C. It taught me the basics - memory, pointers, writing data structures from scratch - but most of the time it felt like I was just trying not to break things. Solving problems became more about handling the language than understanding the logic. Then I came across Ja…

> Solving problems became more about handling the language than understanding the logic. I've worked with Java for 25 years and have a love/hate relationship. Java garbage collection is both great, and terrible. Sometimes objects are instantiated in a method, and should be marked for GC when you leave the method but aren't. There isn't logic or reason, and it trips up juniors hard and reworking "new" features like st…

> Java garbage collection is both great, and terrible. Sometimes objects are instantiated in a method, and should be marked for GC when you leave the method but aren't.

In the last decade of writing Java software I didn't ever come across a genuine GC bug where a unreferenced object wasn't collected. I'm not disputing that they exist, but if you regularly hit such "bugs" I'm wondering if your understanding of Java GC might be flawed.

Do you expect objects to be immediately collected when they are not reachable anymore?

Re: Java is still worth learning

#49

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. Having to manage your own memory, build your own data structures, it can be fun, but it's less fun once your brain is already wired to expect these things to be done for you.

Re: Java is still worth learning

#50

Advocating that people use either Quarkus or Spring is like advocating they build their stuff in COBOL. Java is an alright language by itself, but the "EE" frameworks and the ecosystem that surrounds them are corrosive to good software. You are actively harming your brain by learning JavaEE. If you do that to new developers you deserve to have your beans turn undiscoverable on Christmas Eve.

Spring and Quarkus are not Java EE.

Probably OP meant that they are ubiquitous in Enterprise settings, no that they're part of "EE Java".
Post reply on HN