Live data from Hacker News

Tell HN: I kinda want to go back to Java

news.ycombinator.com

31–40 of 45 posts

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

#31
Java is quite popular, so it's easy to go back. But try C# out. It's years ahead of Java in performance, features, and syntax quality.

I've been doing .NET for years and had to spin up a Java Spring Boot app and it was so painful compared to .NET (esp maven/gradle vs nuget).

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

#32
This logic makes no sense to me. Names aren't an inherent property of languages; the names you didn't like come from either someone else's "framework" or your own design decisions. Lots of Java code has short names (including single-letter iteration variables), and lots of Python code has long names — for example, the standard library `email.errors` has a class called `InvalidMultipartContentTransferEncodingDefect`. The number of things to name, meanwhile, is purely a consequence of the problem domain, how you model it, and how you factor the code.

"Give me a name for this thing" is the last micro-managing coding task I would assign to an LLM, because the entire point of the name is to express my own intent behind the code.

Besides which, you haven't identified something you actively dislike about Python, just that a problem you supposedly used to experience in Java is supposedly ameliorated now.

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

#33
Java is an amazing language, but about 4 years ago I moved to Kotlin (back-end): It has all the powerful Java features but it is way simpler to write and also nullability is embedded in the language (no more @NonNull @NotNull Optional stuff). You might find a balance: the power of the JVM and its ecosystem that you can access through a beautiful language that is Kotlin.

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

#34

I've been sort of thinking the same. The Context Dependency Injection stuff was so great, allowed creating things on demand and in different scopes of demands so easily. Jax-rs annotations mostly worked fine & had sufficient hooks to make API writing pretty easy. I never really was super concerned about verbosity. LLM's should help here yes. Maven was an interesting blessing and a curse. Theres so many plugins that d…

> The Context Dependency Injection stuff was so great, allowed creating things on demand and in different scopes of demands so easily.

OP is currently working in Python, so that seems to me like a wild justification to go back to Java.

Elsewhere ITT someone is praising Java for having the ability to keep large codebases organized and comprehensible. But my experience of Java was that the overall boilerplate, focus on classes, manifest typing, functions not being first-class objects, etc. make the codebase large. Then it gets ballooned even further with systems designed to introduce dynamism into a fundamentally static language.

As I've pointed out in other threads before, "dependency injection" in a dynamic language is approximately a fancy term for "passing an argument to a function". Oh, but it already looks for a global and you don't want to rewrite it for some reason (even though your compilation step is trivial)? That can be addressed with a pretty small decorator. It seems like a lot of why these frameworks exist in Java is so you can reuse implementations of "design patterns" that fix problems Python doesn't have in the first place. By the way (since I just checked it out of curiousity), the code for the Spring framework is comparable in length to the entire Python standard library, including tests.

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

#35
post #23

I worked briefly with Java/Kotlin a couple of years ago. The language is nice (better than I remembered it). What’s absolutely awful is the build tools around. I hate gradle. It’s overly complicated. The whole bom, settings gradle, build gradle, jars, etc. Nonsense.

I've never understood the enthusiasm for gradle over maven. My best guess is that some people just hate XML that much

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

#36

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 con…

I program primarily in Typescript and Golang these days. And yes, most corporate js people tend to not know much about things like dependency injection until they end up with the kind of problems that led to dependency injection in the first place. But Javascript/Typescript caters to everyone's taste and level. If you want to do enterprisy stuff and write properly constrained software - you get to do it.

Working in a language that tries to enforce "type" discipline and certain conventions really gets you down to solving problems the right way - instead of just hacking together a workaround. So most of the time, people who write Java tend to be more thoughtful about their approach to various things in a way that the typical Javascript developer probably isnt.

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

#37
post #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…

Honest question, going back to Java, dont you miss scope functions (let, apply, also, etc)? Extension functions? Using sealed classes and "when"? I am happy to see Java (and the JVM) improve but it still seems to be missing some of Kotlin's best language features.

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

#39
post #23

I worked briefly with Java/Kotlin a couple of years ago. The language is nice (better than I remembered it). What’s absolutely awful is the build tools around. I hate gradle. It’s overly complicated. The whole bom, settings gradle, build gradle, jars, etc. Nonsense.

> I worked briefly with Java/Kotlin a couple of years ago. The language is nice (better than I remembered it).

Note: Java and Kotlin are two different languages :-)

> I hate gradle. It’s overly complicated.

People hate build systems, that's how it is.

Post reply on HN