Live data from Hacker News

Tell HN: I kinda want to go back to Java

news.ycombinator.com

11–20 of 45 posts

Re: Tell HN: I kinda want to go back to Java

#11
The thing is, if you last looked at Java in 2018, prepare for a nice surprise. I mean, we were at version 11 back then, the language has made advances in leaps and bounds.

Just to name a few: half of ML is here (records, pattern matching), we have virtual threads and soon structured concurrency, ZGC, and many more. Project Valhalla (value classes) has been long in the making, hopefully landing in a few years.

Frankly, I had worked with Kotlin and Scala in the past, but nowadays I barely see the need. Yes, Kotlin has if-expressions and null safety and immutable collections, Scala has its type system, but there are also many compromises, and to be honest, these alternatives look less and less appealing as time passes.

Re: Tell HN: I kinda want to go back to Java

#12
I've written a lot of Java in years past but I focus on C# these days. I suggest looking instead at the .NET ecosystem, focused on C# as the language and the huge library support for it - and basically all of it compilable to WASM in the browser via Blazor if you want to do web dev with it instead of JavaScript/Typescript.

Re: Tell HN: I kinda want to go back to Java

#13
At this point, I've used Kotlin longer than I've used Java. There's some new features in Java like nullables, but they're still too verbose. If you like the style of Java with a little functional flavor, Kotlin is about right. If you like the OO stuff, then C# seems to do that better.

Re: Tell HN: I kinda want to go back to Java

#14
Consider Scala rather than Java. After a decade of enterprise Java development I decided to pivot to Scala after seeing the side-by-side code examples in the Play Framework documentation. Scala code is much more succinct and expressive than Java.

The gap has narrowed in recent years, but all the new features of Java have been there for years in Scala, and with neater syntax in Scala. Many Java design patterns are built into the Scala language itself, and the type system is phenomenally powerful. It’s a language where I am constantly learning, even ten years in. It’s wonderful.

Re: Tell HN: I kinda want to go back to Java

#15
Programmed over the years in almost all mainstream programming languages at one time or another.

Saying this, Java was and is in many ways one of the best ecosystems to write software out there, if not the best (when it comes to server side software).

Maven is my favorite build systems so far: Default directory layout means everything has its place, IDEs can easily open any kind of Maven project, and being declarative, one can easily analyze pom.xml files. (I hate writing XML and I still like Maven.)

The next thing is Javas standard library. Well documented and big. Has it better and worse parts? Sure! But what people which never used a language with a good standard library don't get, is that even a bad standard library which is widely used is far better, than the npm-of-the-week clusterfuck, which means that nobody can read three lines of code and really understand, what is happening.

The IDEs are top notch, and you get even free ones (NetBeans, Eclipse) which can rival JetBrains and Visual Studio easily.

... and finally, Java is the only language that I know of, which has multiple strong companies and initiatives behind it, thanks that nobody trusts Oracle (rightfully).

Finally, Java code also got shorter, DI style is IMHO a very good default in any programming language (OOP, FP, Imperative), the community settled mostly on JUnit, so there are never discussions which of the 23 competing test frameworks to use...

In the end, there is a lot of rightful criticism of Java (historical baggage, too late when it comes to AOT, no modern GUI frameworks and a steep learning curve). Java getting new features with the new JDK releases is kind of double edged sword: Many things are good ideas, but they make the language more complicated at the same time.

The verbosity was IMHO never a big thing, because Java was always meant to be used in an IDE, for bigger projects explicit trumps implicit and finally newer revisions introduced stuff like 'var' statements etc.

It is kind of sad, that the Linux community never really jumped/accepted Java for desktop development (which might be explainable, when looking back at the lack of speed of Java in the 90s and the disastrous Solaris Java apps which were simply to slow to be usable).

Anyway, for work I am now using Golang, and it is hilarious how many lessons Golang did not learn from Java, when it comes to language design, although the tooling is top notch and the standard library has at least almost everything needed for writing backend services.

I don't see Java making a comeback, and I don't see anything modern going to replace java at the same time.

Re: Tell HN: I kinda want to go back to Java

#16

My main gripe with Java is not the language, but the organizations that still write their systems in it. I just don't want to go back to working for banks, insurance cos, govt departments.

It's shocking how much of the world runs on old java code on tiny Linux systems

Re: Tell HN: I kinda want to go back to Java

#17
post #6

I’m sorry, you think Python helped us invent LLMs and without it we wouldn’t have? Are you serious right now? You do realise the Python libraries which work in this space are written in C, right? Java wasn’t just too verbose, it had bad IDEs and build systems. If you want to go back, might I suggest Kotlin or C#?

I hate Python more than anyone I know. My nightmares are filled with people repeatedly chanting "programming is done by consenting adults." Hearing someone say "Pythonic" as a synonym for clever/good, or having someone explain their latest "genius" GIL workaround... boils me.

So it gives me no pleasure to say this, but one would have to be a complete fool to believe Python wasn't absolutely instrumental in the AI revolution. I'd go as far as to say Python is the reason data science is not just more software engineering. NumPy/Pandas/SciPy/TF/Torch/etc core could be written in $SPACE_ALIEN_WAY_BETTER_3000 for all it matters. If they were not built for Python ingestion, they wouldn't have been used by most of the world.

There is some special sauce in Python that clicks with people. Something in the looseness and metaphorical play between the joints, I think. Pretending otherwise is that willful ignorance some software folks have when their toy is no longer the shiniest.

(Also, sure Maven sucked, but saying Java had bad IDEs? IntelliJ or death! Or, you know, death until something better comes along)

Re: Tell HN: I kinda want to go back to Java

#19

My main gripe with Java is not the language, but the organizations that still write their systems in it. I just don't want to go back to working for banks, insurance cos, govt departments.

Isn’t Java also used all over Silicon Valley? Maybe not the latest and hippest small startups, but still in many other more established orgs including FAANGs.

IMHO what you describe is more attributable to .NET.

Re: Tell HN: I kinda want to go back to Java

#20
As a TypeScript lover here are the things I dislike about Java:

* Comparably slow startup. It seems to take so much long to compile the code and startup the JVM for a large application compared to a similar JavaScript/TypeScript application.

* Yes, Java is verbose and that can be annoying but this super low on my list. I can work with this.

* Java forces OOP on you. The original benefit of OOP is efficient memory conservation, but these benefits are lost on garbage collected languages. The primary reason OOP continues to exist is stylistic preference and it’s a preference I don’t like.

* Error states and stack traces feel like a drunk person throwing up. They are all over the place, far too large, and feel like they blame the user for even daring to execute the code.

It’s not all bad. People who write Java seem like they know what they are doing, and I am fully aware this me being naive. Most corporate JavaScript people absolutely have no idea what they are doing. The difference in insecurity and output is strikingly visible from a distance.

Post reply on HN