Live data from Hacker News

Java Is Underhyped

jackson.sh

191–200 of 808 posts

Re: Java Is Underhyped

#191
post #96
post #55

Earlier quoted context omitted.

Another reason to avoid: Oracle owns Java. This automatically puts Java on my list of tools I'd prefer to avoid for new serious projects. (Legacy projects; if it's working and it isn't an issue yet, maintenance.)

Use OpenJDK! Never touch anything from Oracle. Then you will be fine. Oracle is the company that wants you to buy a license for your MariaDB(!) instance running on a small AWS instance! Yep, that happened. Source: have worked with Java for years, three of those around Oracle products.

[deleted]

Re: Java Is Underhyped

#192
post #54

Being excited about Java is like being excited about dirt—not any particular dirt, just dirt in general. Yes, practically everything that grows grows in dirt, and anybody can walk on dirt, and in a pinch you can throw it at people or dig a hole and crawl in. Dirt. Java was designed by people who had absolutely no intention or desire to ever use it. They cribbed parts from other languages they didn't really understand…

I think that Java is more like “concrete” than dirt. Fairly gray, unexciting and utilitarian, but nevertheless much of the world is reliably built on it.

Re: Java Is Underhyped

#193
post #176

Earlier quoted context omitted.

I've seen plenty of even small Java projects becoming hard to manage as well. The design pattern hell is a thing. You know the joke: a dev has a problem, uses Java, and now has a ProblemFactory :) Not to say Java is not a great language for big projects, it certainly is well equipped for that, especially because it has superb tooling available on the market. But I've done plenty of big projects in Python, some ended…

> You know the joke: a dev has a problem, uses Java, and now has a ProblemFactory :) I think this joke is probably about as dated as the versions of java it was made about.

Unfortunatly, I know a lot of devs that don't even know it's a joke.

Singleton is still a design pattern used in the wild.

Re: Java Is Underhyped

#194

Earlier quoted context omitted.

I've seen plenty of even small Java projects becoming hard to manage as well. The design pattern hell is a thing. You know the joke: a dev has a problem, uses Java, and now has a ProblemFactory :) Not to say Java is not a great language for big projects, it certainly is well equipped for that, especially because it has superb tooling available on the market. But I've done plenty of big projects in Python, some ended…

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

The crap people created on top was typically responses to deficiencies in the language, whether they knew it or not.

Stuff like "everything is a class".

Re: Java Is Underhyped

#195
I think, there are three things in this one. JVM, Java itself and how it is used.

JVM is great. I think it gets a lot of love (in comparison with .NET Core which is IMHO as good as JVM). In this one, you see JVM everywhere except desktop apps.

Then, there's Java itself. As a language, it really isn't as modern and doesn't provide much what isn't already available in C#, Scala, Kotlin, or even PHP or TypeScript. And it doesn't provide some things that other languages have. So on this scale, once you know Java, you can be productive, but I doubt you will be more productive than someone who knows C#, Scala, etc.

And then, there's Java culture. Plenty of Java devs (mainly in J2EE, Spring world) don't develop in classes, they develop in design patterns. AbstractFactoryStrategy, complete abstracting out databases, five layer data models, classes for things that should be enums. It's a matter of taste, you don't have to do it (Android devs don't do this that much even when they use Java). And I think all the coolness of modelling, UML, etc. is over.

I think, you can be productive in Java (if you use it a bit like PHP). I think JVM is fantastic. For me, I am 8 years in Clojure world and I wouldn't go back to design patterns, writing (in Java often generating) dozens of lines of code just to insert something to the database (entity, mapping, repository, business logic layer, etc.) when in Clojure, this would be three lines (defn, schema check, insert).

Re: Java Is Underhyped

#197
post #172

Earlier quoted context omitted.

How did you manage to miss the entire point of the comment?

I didn't, thanks. I think that there are use-cases in which java is more performant than his low-performance options, and can be as performant as his high-performance options, while providing a much larger ecosystem. I think the parent poster actually makes a very weird set of choices - "when my high level choice, python, is not cutting the mustard, I am happy to throw away breadth of support entirely in the name of…

Eh, kinda still sounds like you did. Thanks for removing any doubt.

Re: Java Is Underhyped

#198

Earlier quoted context omitted.

I've seen plenty of even small Java projects becoming hard to manage as well. The design pattern hell is a thing. You know the joke: a dev has a problem, uses Java, and now has a ProblemFactory :) Not to say Java is not a great language for big projects, it certainly is well equipped for that, especially because it has superb tooling available on the market. But I've done plenty of big projects in Python, some ended…

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

Yeah I was teasing a bit.

Same goes for Python. Reading the hacky code of a geographer for his SIG system is rarely a fun day.

Re: Java Is Underhyped

#199
post #7

There are a few reasons to avoid Java today. - The programs are very verbose for the functionality they provide. There are countless lines of getters, setters, and trivial constructors. While IDE helps to write them, it makes reading existing programs slow and frustrating. Lombok helps, but very few programs use it. - If you do want to use Java ecosystem, there is Scala. It also has strong type system, nice IDE suppo…

The GC comment was true of older versions of the JVM but newer versions are much better. And by newer I mean versions released in the last 5 years or so. So not that new.

There are one or two knobs left but those are fundamental to GC technology and it's not even obvious they're bad to have. GC lets you trade off memory against CPU time in ways manual memory allocation does not. You can throw memory at your program and it'll run faster, or you can constrain it and it'll run slower, but that's not a decision the developer can always reasonably make. It's in some ways inherently an ops/deployment/end user thing.

Other GCd languages either:

1. Have knobs too (Go/.NET both have knobs), just usually not very good ones.

or

2. Are so slow (Ruby, Python) that GC tuning is really the least of your worries and they just don't expose it at all.

or

3. Are JavaScript, in which case everyone pretends that running a VM designed exclusively for laptops and mobile phones on the server isn't a giant waste of resources. V8 doesn't do GC tuning because its only real customer is web browsers where users can't do that, and heaps are small anyway.

Java ended up getting a totally unfair rap about GC because it actually was fast enough that GC performance mattered, and was interested in power users on the server where exposing knobs can make sense. Other competitors don't even try, but this doesn't make them better. After all, nothing stops you just ignoring the knobs and plenty of users do exactly that.

Re: Java Is Underhyped

#200

Speaking as a near 20 year Java programmer, Java is criminally bloated at every level. The ecosystem has been covering for its shortcomings since y2k. That ecosystem is so thick and full of abstraction that no two devs from different framework backgrounds would recognize the others code as Java. And the abstraction... it is a language for people who are more interested is the abstractions than actually getting things…

The ecosystem is large and diverse. But you don't have to use everything! You don't have to use anything!

I make a point of starting all new projects with just the JDK, and taking that as far as possible before adding dependencies.

A 40k LOC codebase i work on has these external dependencies (plus some company- and vendor-specific libraries, which we would need in any language):

1. Netty, for serving HTTP

2. Glassfish JSON, for parsing and formatting JSON

3. FastUtil, for efficient collections of primitives

4. Guava, purely to get PairedStatsAccumulator

5. SimpleFlatMapper, to parse and format CSVs

No frameworks, no criminal bloat.

For the first few years of its life, this app used the JDK's own HTTP server, which was fine. Then we wanted to add websockets, so we needed a more sophisticated server.

If there is a problem with Java here, it's that people don't realise you don't need frameworks. A lot of developers will reach for Spring, Java EE, or something else like that right at the start of a project, without questioning the need for it. But this is not a failing of the language, or a problem you have to impose on yourself.

Post reply on HN