Live data from Hacker News

Java Is Underhyped

jackson.sh

321–330 of 808 posts

Re: Java Is Underhyped

#321
post #112

> Java is fun to write, productive What the hell? I don't think we have the same definition for any of these words. I know Java has changed quite a bit since Java 8 (Java 9 being the last version I used professionally before switching completely to Go), but I just can't write Java again, it's physical. When I want to try a new Java feature and think about writing the scaffolding code, my stomach actually hurts. Not t…

>When I want to try a new Java feature and think about writing the scaffolding code, my stomach actually hurts.

Like, if you're out of work for a couple of months and the only way to feed your kids is to take a Java job, I don't think you'd pass it up. I wouldn't pass it up either even though I don't like Java. The whole language feels like it's designed to meet some minimum lines of code requirement.

If you're working on a team, strongly typed languages like Java and C sharp are a must. Otherwise it can get extremely hard to figure out what exactly other people are doing.

Re: Java Is Underhyped

#322

Earlier quoted context omitted.

> You know the joke: a dev has a problem, uses Java, and now has a ProblemFactory :) I LOL’d at this joke (again) because it’s true, but if we’re honest, it’s also unfair. ProblemFactory is a bad idiom, rather than anything to do with Java The Language. You could (and IMO, probably should) just use a new Problem(). Java The Language was very stable for a very long time, so IMO the hype and fads got built on top. Firs…

> I LOL’d at this joke (again) because it’s true, but if we’re honest, it’s also unfair. ProblemFactory is a bad idiom, rather than anything to do with Java The Language. The Factory pattern’s pervasive use in Java was in large part a fairly direct consequence of JavaBeans requiring nullary constructors, so that the normal constructor work for a Bean had to be done elsewhere, i.e., by a Factory. Now, Beans was just a…

I’m not going to say you’re wrong because you are probably right :) but I don’t remember things happening in that order. JavaBeans was a super early Java spec and it introduced some (IMO) poor idioms, such as the mandate to use getters/setters. And I certainly agree that JavaBeans had a huge influence over the rest of Java culture (for the worse IMO).

But my memory is that pervasive use of Factories came along many years later, and seemed to be driven by the perceived needs of TDD, for example to provide instances of mock classes in unit tests. And I thought the factory pattern itself came from the GoF, but I might be misremembering.

That said, I’m not trying to contradict you. It’s likely that there was more than one driver for the pervasive adoption of factories. In any case it was a bit of a nightmare for a while, hopefully things are improving there now.

Re: Java Is Underhyped

#323
post #124

Earlier quoted context omitted.

> For the people who say that Minecraft should have been written in C++ […] there's Bedrock Edition. Nobody I know cares about it enough to play it. Been playing for just under ten years, everyone I know plays Bedrock these days. I built and manage a very popular tool / Minecraft community and while I don’t have actual numbers, my general sense is the majority of players run either console or mobile Minecraft - all o…

>I don’t know why you wouldn’t run Bedrock Because not everybody runs Windows? I don't consider mobile and console platforms as gaming, but that's just my biases.

> I don't consider mobile and console platforms as gaming, but that's just my biases.

Gatekeep much? You know that you just excluded probably 90% of all gamers right there?

Re: Java Is Underhyped

#324
post #261

Earlier quoted context omitted.

Kotlin solves most of the problems for us while leveraging the benefits of the JVM.

Are there many companies seriously using Kotlin for large projects outside of the Android space?

Yes, our stack is Spring Boot + Kotlin on the back side, TypeScript + Vuejs on the front. We’ve millions of unique visitors each month, and we’re pretty satisfied with the stack.

Re: Java Is Underhyped

#325
The ultimate problem with Java (and OOP too, even in the Kay's sense) is that its philosophy represents a very paternalistic approach to software development. The idea is here are these things called objects, you can't look into them, and you only have to use them the way they are designed; under no circumstances you can break them down into internal components and remix those freely.

In Java, this overall approach manifests in myriad of different ways:

- Functions and data are tied together. It's difficult to create new functions (methods) that operate on existing data, you have to inherit, and even that avenue can be closed, even indirectly because you find that you cannot actually get to some internals.

- Interfaces are tied to objects. You cannot explain to the compiler that a given class actually supports a certain other interface in the way YOU define it.

- Everything is a reference, no value types. No need to worry about the intricacies of cache management, we will handle that for you.

- No need to worry about CPU optimizations or memory management either - we will do that for you, without an escape hatch.

- You cannot change the existing operators to introduce more convenient syntax, because I said so. Any kind of "macro" - code generators, compile-time checks, conditional compilation, DSLs - forbidden.

- The class and package hierarchy determines the access to its components. No way to override this from the outside, no way to expose things that are hidden. Worse, this is implicit, for example, class method accesses an object attribute, where taking a parameter would be more convenient; this hurts reusability pretty badly.

Some of these shortcoming are only now being addressed, because people actually need to do these things anyway, in certain situations, which leads to proliferation of patterns and magical code generators.

Re: Java Is Underhyped

#326

Earlier quoted context omitted.

You use Java because it is low risk. I think it might be lower risk than any other language in terms of design patterns, hiring, library support, run-time surprises, etc. The language itself isn’t great though. Java solutions tend to be bloated and make it hard to decipher the underlying domain logic. I certainly wouldn’t pick Java for a small team of experienced developers.

Progressively slower development seems like a pretty massive risk these days, where not being able to chase a competitor's big feature can be the death knell to your company. Though it seems java in general attracts a culture of slow moving bureaucrats which doesn't necessarily translate into higher quality (in fact, I'd argue it translates into worse quality).

> Progressively slower development seems like a pretty massive risk these days, where not being able to chase a competitor's big feature can be the death knell to your company.

You are conflating to different layers. Not being able chase a competitor's big feature can be the death knell to your company, yes. But this does not mean that building your business software on stable and proven foundations is a high risk. On the contrary you want to be fast moving with your business features not with keeping up with quicksand under your feet. I.e. a stable well understood basis, is IMHO a prerequisite to moving fast above of it.

In addition to my arguments above, one still has to consider whether a tool matches the problem. Writing an Excel plugin in Java is probably a very bad idea (I really don't know, I just assume that anything based on .NET would be a better fit), although both Excel and Java value long term compatibility. If you want to follow the latest trends in AI without really understanding what is going on, it is probably best to follow all the tutorial about AI and use Python. But if you plan to hire people that understand the details of AI libraries, you might come to the conclusion that the AI libraries on the JVM also provide the basic blocks you need, the higher levels are customized to your application anyways.

To come back to the original point, a technology or programming language is not good if it moves fast, it is good when it fits your problem, doesn't create too many new problems, is well understood by you and your team and is maintained.

Re: Java Is Underhyped

#327
post #253

I do think Java has a bad rep as a "dry, corporate, enterprise" language, but I think there is an ecosystem around Java that is pretty awesome and you can build incredible applications with Java if you want to. Java has a branding problem. Java (and Oracle) missed the wave of the last 15 years when tech became "cool." If you were new to tech/programming and wanted to pick up a language, which of these three would you…

This is a funny comparison, for sure. What is really going on here is that there isn't a " the Java website". There is no single organisation or project behind Java which could put such up a website. Similarly, where is the C++ website? The C website? java.com was originally the website aimed at end-users who need to install Java to use desktop applications written in Java. It looks like it's from 2010 because that's…

C++ website: https://isocpp.org/

C website: http://www.open-std.org/jtc1/sc22/wg14/

Re: Java Is Underhyped

#328
post #136

Earlier quoted context omitted.

Python projects that start to grow has a tendency to become hard to manage in a way that I have not seen in Java at all. Java is like you say not the greatest at anything but it is also not the worst at anything. Its great for projects where the you don't know what you should optimize for or don't care. If java is to boring maybe kotlin is the way to go. I really like kotlin and in my personal experience the only dow…

I write software in Java. I can't stand python - too wishy-washy. But my main complaint about Python is trying to use someone else's software. Then it degenerates into a maze of twisty little passages of trying to install the correct set of dependencies, not knowing where those files are installed (which makes it difficult on a cluster, as you may need to do the install on every node separately). Then you try using p…

Most python software use the standard venev setup with pip and requirements.txt, and most java software are distributed as fat jars. Nobody manually sets up dependencies anymore.

As a Java/Python/Go developer I can say that packaging is a solved problem as of 2021.

Re: Java Is Underhyped

#329

For my use cases, Java has all the wrong compromises: - not high level enough to compete with Python/Ruby/JS/PHP, etc - not low level enough to compete with Rust/D/Nim/Zig - not specialized enough to compete with Erlang/R/Go/Julia - not opinionated enough to compete with Lisp/Haskell So why use Java ? It's good, it's fast, it's productive, it's well supported, battle tested and documented for decades with a huge pool…

It's horses for courses. Some plus points for Java: - you can integrate code from hundreds of developers fairly safely (knowing that no one has changed the default behaviour fo builtins and different dependencies won't clash). - the syntax, although not the most succinct is fairly easily readable and maintainable by other developers.

>the syntax, although not the most succinct is fairly easily readable and maintainable by other developers

I dislike that people conflate simple languages with easy to read code.

Low level verbose abstractions make code harder to read - going through the layers of IFactoryRepositoryLocatorBullshit because the language abstractions suck doesn't make it easier to read code.

It makes the code more accessible, in the sense that you can probably find some 20$/hour devs to read through that and spend a day solving something that should take a couple of hours most.

Good high level code express the problem domain without boilerplate and let's you focus at problem at hand - Java is terrible at that.

Re: Java Is Underhyped

#330

Earlier quoted context omitted.

Java is so much worse on this front. > with Java, you just dump the necessary jars into a directory, include them in the classpath, and it works. Ant, maven, or gradle, and then some jars, somewhere? What's the classpath and whats $JAVA_HOME for this project? Oh and now I have to make it work in the IDE too, click through a billion menus and dialogs, sync the build system, sync the dependencies, configure runtimes an…

Nobody has started a project with Ant in the last decade. Of all the Java projects on Github Ant is probably not even 1%. > Oh and now I have to make it work in the IDE too, click through a billion menus and dialogs, You click "Project from existing sources" in IntellIJ and it will recognize both Maven and Gradle projects and just work? Sync the dependencies? configure runtimes and classpaths? What? With Maven and Gr…

I only had to go a few comments to see someone (the person you're responding to) think Java is the same as it was 15 years ago.
Post reply on HN