Live data from Hacker News

Don’t call it a comeback: Java is still champ

github.com

371–380 of 557 posts

Re: Don’t call it a comeback: Java is still champ

#372

Earlier quoted context omitted.

Personal rant: I've never understood the hate towards XML. It's a practical and flexible markup language that does not depend on whitespace or quoting every bloody thing. Plus, every markup language invented since has had to re-invent XML things that, surprise surprise were actually needed. Paths, schemas, comments, etc. I get frustrated with JSON because of things I could do in XML that I can't do in JSON without br…

> that does not depend on whitespace This is precisely one of my complaints against XML, it does depend on whitespace. In JSON, I know that any excess formatting whitespace can safely be removed. But excess formatting whitespace is part of the document in XML and I can't know in general whether it can be safely removed or not.

Right, it requires a schema to even know whether whitespace is to be considered significant. And schemas are a whole nother can of worms...

Re: Don’t call it a comeback: Java is still champ

#373

Java was actually not bad for me in class when learning software design and data structures, but soul-crushing to work with in the real world. Mindless, unnecessary use of getters/setters, interfaces, and AbstractFactoryImpls. Hiding almost every piece of functionality behind 10+ layers of indirection. Dependency Injection with Spring. They all make it feel like Java draws folks who actually __enjoy__ writing bloated…

FizzBuzz Enterprise Edition [1] is an oldie but a goodie worth a re-mention.

1. https://github.com/EnterpriseQualityCoding/FizzBuzzEnterpris...

Re: Don’t call it a comeback: Java is still champ

#374
post #138

Earlier quoted context omitted.

I am not convinced that Java is adequate. I do not know if the problems are related to the Java language or to the typical Java programmers, but Java is the only programming language where I have seen a strong correlation between the programming language used to implement some application and a low quality of that application. During decades of experience with various programs, whenever I was surprised that a program…

Java UI and applets have been abandoned long ago (>10 years). This was partly due to webapps becoming the standard, but also the realization that for desktop apps non-native UIs just suck. The vast majority of Java (=running on the JVM) software these days is server-side, without any user interface.

I think that’s true but, Android applications are java/kotlin and run on google’s version of the jvm. there are many Uis people interact with that no longer have any java smell.

Re: Don’t call it a comeback: Java is still champ

#375

Earlier quoted context omitted.

I don't think this is an issue with Java, it's an issue with Spring. I'm baffled by the popularity of Spring.

I think it depends a lot on where you work and what sorts of projects you work on. I've been programming professionally in Java for the last 16 years and I have never encountered Spring. Nor do I typically see the stereotypical sort of FactoryFactoryManagerImpl complexity bloat. It is something you need to watch out for and steer clear of, in particular when selecting frameworks / libraries, but you can definitely li…

> I think it depends a lot on where you work and what sorts of projects you work on

Correct. These frameworks are synonymous with "Enterprise Java", which you're unlikely to encounter at startups on one end, or Google at the other, but at many places in-between

Re: Don’t call it a comeback: Java is still champ

#376
post #255

Earlier quoted context omitted.

The only problem Java has is experienced C programmers don't build servers from scratch with it yet. Please explain. What kind of crazy jack write servers in C? (Real question, trying to learn here)

The developers of apache httpd, nginx, postgresql, redis, among many others?

I see, you guys mean servers not web servers. Makes sense now.

Re: Don’t call it a comeback: Java is still champ

#377
post #288
post #255

Earlier quoted context omitted.

The developers of apache httpd, nginx, postgresql, redis, among many others?

you really dont need redis if you have java. I see zero reasons to offload my datastructures via TCP, instead of have them locally. If need be, replicated them.

Redis has plenty of features your java program hasnt. Starting with reliability :)

Re: Don’t call it a comeback: Java is still champ

#378

Java was actually not bad for me in class when learning software design and data structures, but soul-crushing to work with in the real world. Mindless, unnecessary use of getters/setters, interfaces, and AbstractFactoryImpls. Hiding almost every piece of functionality behind 10+ layers of indirection. Dependency Injection with Spring. They all make it feel like Java draws folks who actually __enjoy__ writing bloated…

I'm exactly the opposite! I hated Java in school. I was going to switch careers because of it.

I eventually graduated and my second job was a Java SWE.

I realized it's not just you sitting in a void on a theoretical BS questions. You have a team to talk to and get help from. If you forget what a HashMap is called, you don't get stuck trying to declare a HashArray with an automatic fail grade on the same level as someone who did literally nothing and handed in literally nothing.

Then I got a few years experience as a SWE and I realized my original assumption WAS correct. You are stuck in a void answering BS leetcode questions, and you DO automatically fail if you get stuck declaring a HashArray with otherwise perfect logic.

Indeed, technical interviews are so fun. Especially the fully automated ones, but honestly even the ones with interactive humans they still can't comprehend how somebody could POSSIBLY mistake a HashMap as a HashArray unless you were literally fake trash.

Re: Don’t call it a comeback: Java is still champ

#379
post #161

Earlier quoted context omitted.

Generics, LINQ, structs, delegates, to name just four.

Can you explain why you think C# does those things better than Java? And what they correspond to in Java?

Sure. Reified generics, along the lines of C#[1], rather than Java, is the only sane design. Erasure of generics works fine in languages that have the "parametricity" property, where you cannot observe any characteristics of a polymorphic value. That doesn't hold as soon as you have casting.

Java generics have a couple of unfixable problems.

For one, you can have List and List both be passed to a place where Object is expected. But getting them back from that place and trying to recover what was known at creation time, would normally be done with a cast. But List and List are not runtime distinguishable from each other. Such a polymorphic cast in the code is just syntactic sugar; you'll get a compile-time warning, but no runtime check! E.g. You can get a naked List and cast it to a List and then go ahead and try to use it like a List. It will only fail when you get an actual non-Bar thing out of the list. It pointedly won't fail if you take your List and pass it to other generic code that does more generic stuff with it. And it won't fail if the list is full of nulls, is empty, etc. In essence, it's completely dynamically typed at that point. The static generic types are lies. In reality, all generic Java code compiles down to non-generic code with runtime casts everywhere. That costs performance and means that you can screw up.

Second, erasure also means that you cannot be polymorphic over primitive types in Java, as the VM doesn't support that in the bytecode. So you can't write really basic stuff like Vector, array sorting code, and now, closures and lambdas, that manipulate primitives. All that has to be duplicated, once per primitive type, and for objects. Or you have to box stuff. So they added implicit boxing (autoboxing) so you don't have to type those characters. But they are there in the code. You're stuck with either duplicating for performance (hand-doing template specialization, if you will), or just creating an assload of garbage.

[1] I say "along the lines of". I designed Virgil's generics system not knowing C#, but working from what I knew from ML. It ended up with a lot of the same choices, but I mapped ML's "unit" onto "void" and that works out nicely for zero-arg and/or zero-return functions. You can even have an Array in Virgil! And none of it creates boxes or introduces unsafe casts.

Re: Don’t call it a comeback: Java is still champ

#380

Java was actually not bad for me in class when learning software design and data structures, but soul-crushing to work with in the real world. Mindless, unnecessary use of getters/setters, interfaces, and AbstractFactoryImpls. Hiding almost every piece of functionality behind 10+ layers of indirection. Dependency Injection with Spring. They all make it feel like Java draws folks who actually __enjoy__ writing bloated…

What's your take on Kotlin? Neatly solves a ton of these issues.

I’ve looked at Kotlin but haven’t used it. It seems like it was designed carefully, and conceptually, I think Jetpack Compose is pretty cool. Is there a (non-Spring-like) Kotlin server-side framework you would recommend taking a look at?
Post reply on HN