Live data from Hacker News

Should I Learn Java in 2018

e4developer.com

91–100 of 165 posts

Re: Should I Learn Java in 2018

#91
post #45

One annoyance with Java(and Kotlin too) is that it's pretty much the only language left that you really ought to use a specialized IDE with while pretty much every other language(including C#) you can get adequate support in VS Code or Emacs.

I think its the other way, there are only a few languages with as superb IDE support as Java. AFAIK its just C++, Java and C#. You can get shitty support with just syntax coloring for anything and anywhere of course.

That gap is closing – e.g. VS Code has refactoring, definition lookup, linting, etc. support for Python, JavaScript, TypeScript, Rust, etc.

It’s still not what the top IDEs can provide but it’s way more than syntax highlighting and since everything is open source it’s improving a lot faster than the commercial market.

Re: Should I Learn Java in 2018

#93
post #65
post #51

Earlier quoted context omitted.

Hmm. Just checked memory use on some services we run on Go, Node, and Java. I'm not part of the Java team but results: Go: 40M Node: 64M Java: 4GB Any Java service I've seen in production has similar numbers. Coupled with the incredible startup time it's hard for me to see why you'd pick it in 2018.

JVM uses as much memory as you allow. Use `-Xmx39m` to beat Golang.

My guess is that it won’t work with less than 1GB bc of spring boot, hibernate and all the rest of Java enterprise “microservice” goodness.

Re: Should I Learn Java in 2018

#94

> Concern 5: Java is too slow/consumes too much memory It's sad that this is still a thing. Compared to more trendy languages like Python and Javascript, Java is very light on memory. JS is known for being fairly fast and "light", but its actually 5-10x slower than Java and uses 5-10X more memory. And the whole "lightness" of it is a lie. Javascript's run-time is probably bigger and more complex than the JVM. Java us…

How efficiently does Java run when compiled to the browser platform? (e.g. WASM)

(The browser is an important target these days, so imho this question must be addressed; besides, I want to be able to use the same code on the server as on the client; and sadly, the JVM isn't guaranteed to work in every browser).

Re: Should I Learn Java in 2018

#96
post #79

I have been developing backend systems in Java, professionally, for the past 15 years. You should not base your career choice of being Java programmer or not solely on Java's popularity. There are genuine good reasons to learn niche technologies especially if you like them more. I think if you genuinely like something you are much more likely to succeed in that field and it is better for you no matter the size of the…

> Oh, and you will be working with a lot of people that barely can write a loop. That's that. I said it...

It's funny although it's true. I'm not a programmer, but that's the profile of the Java developers that worked in my team. Sad, really...

Re: Should I Learn Java in 2018

#97
I just yesterday managed to compile a little utility program of mine in java using openjdk 10 and then via https://github.com/moditect/moditect link together linux and windows binary packages which run on both platforms without a JVM and weigh in at ~35mb. It impressed me that something like that is now possible with Java.

Re: Should I Learn Java in 2018

#98
post #79

I have been developing backend systems in Java, professionally, for the past 15 years. You should not base your career choice of being Java programmer or not solely on Java's popularity. There are genuine good reasons to learn niche technologies especially if you like them more. I think if you genuinely like something you are much more likely to succeed in that field and it is better for you no matter the size of the…

All true. Unsexy projects or not, I work on really big data problems and I never once considered it boring. I love Clojure, I wish Clojure had taken off, but it fizzled (sorry, Neal Ford). Groovy was #2 for me, but Java 8 killed it because Java 8's lambda is good enough to accomplish that. Groovy is just barely hanging on now and I don't think anyone is starting new projects with it. Same with Scala. Kotlin could rise, we'll see.

I don't love Java the language, I never have, and Sun and now Oracle have much to answer for over the years. But, it's dependable. I make very decent money and although I have had to mentor a lot of youthful developers (who can barely write a loop, as you say) I do that without involving my ego in the process and take the high road, not the low road. If someone wants to learn, I teach them. I've had the unique opportunity to have a very positive effect on so many people's careers because I didn't act like the typical rock star programmer asshole who brushed them off (which by the way is why I quit my previous job--too many rockstar personalities lacking compassion).

Realistically, for most of the US, you are looking at either the Oracle or the Microsoft ecosystems and the rest makes up some smaller sliver of the pie. Just go look at the TIOBE Index.

Re: Should I Learn Java in 2018

#99
post #53

> Concern 5: Java is too slow/consumes too much memory It's sad that this is still a thing. Compared to more trendy languages like Python and Javascript, Java is very light on memory. JS is known for being fairly fast and "light", but its actually 5-10x slower than Java and uses 5-10X more memory. And the whole "lightness" of it is a lie. Javascript's run-time is probably bigger and more complex than the JVM. Java us…

> but its actually 5-10x slower than Java and uses 5-10X more memory I am definitely against the "Java is slow" claims and think they are mostly rediculous but so is this claim. Saying "uses 5-10x more memory and 5-10x slower" goes against every benchmark I've ever run and my understanding. Mostly because JavaScript runs on several JITs (V8, JavaScriptCore, SpiderMonkey, Chakra) with different performance goals and c…

>Slowness isn't a property of the language it's a property of the runtime

This is true to an extent, but look at the time and money poured into PHP and how slow it still is after all these years.

Language design choices have a huge effect on how fast the runtime can be. In Javascript, objects are stored as a map of key->value pairs, and aren't strongly typed. This design requires more overhead for type checking and many optimizations used by strongly typed languages won't work. Even in toy benchmarks its clear that Java has a performance lead https://benchmarksgame-team.pages.debian.net/benchmarksgame/... . It's slower than java on every test.

You don't see the memory difference because these toy benchmarks don't allocate much. Node/JS will always use more memory for storing objects, sometimes far more because it isn't strongly typed. In Java, an array of ints will use 32 bits * size plus some fixed bytes. In Javascript, each item in the array can use 2-3x the max "size" of the number, because the runtime can't figure out what type it should be.

Re: Should I Learn Java in 2018

#100
post #87

Earlier quoted context omitted.

If you tell your Java application server "here you have 4GB, use it as you wish" it will happily comply and trade memory for performance. In most of the cases it's just a matter of setting a few Java runtime startup parameters.

It's disrespectful to take 4GB if you don't need it. This should never be the default...

Read the comment again:

> If you tell your Java application server "here you have 4GB, use it as you wish"

Post reply on HN