Live data from Hacker News

Should I Learn Java in 2018

e4developer.com

81–90 of 165 posts

Re: Should I Learn Java in 2018

#81
post #58

I think that its time that the enterprise switches to full stack Typescript as a much better solution for developing enterprise software. Why use two languages and two different ecosystems for the backend and for the frontend, when we can use only one? It makes hiring a lot easier too. Let's face it the Java ecosystem is stagnated and has lost a tremendous amount of mindshare in the last 7 years. The level of modular…

> Why use two languages and two different ecosystems for the backend and for the frontend, when we can use only one?

Why use a hammer and a screwdriver when you could just use the hammer?

Do people really make blanket decisions like this for their projects instead of properly evaluating what the project's actual needs are?

Re: Should I Learn Java in 2018

#82
post #71
post #65

Earlier quoted context omitted.

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

Yeah, but they all seem to need high mem amounts or they OOMException.

Well, it may also be a bad code written by amateurs which use memory inefficiently.

Re: Should I Learn Java in 2018

#83
post #51

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

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.

Who the heck wrote the Java service you are referencing? Anectdotal, at best, or the result of poor development effort. Incredible startup time? Is it Websphere-based, perhaps? Are you comparines apples to apples? I mean, I haven't seen many Node-based or Go based services that do very much in comparison to what our Java based ones handle--pulling in mountains of data from multiple sources in Cassandra, streaming it through Kafka to make it available to a cluster of processing nodes as well as making it available via our APIs. Are your Go service comparably sophisticated?

There is no way my company could have gotten better results using Node, we have played around with Express and wanted to try writing some microservices using Javascript. Basically, it sucked big time. The speed wasn't there, the tooling wasn't there.

And Go sounds great, and maybe it will be in timne, but the infrastructure, tooling, and libraries just aren't that evolved yet. With Java, you can get things done and have reliable services that run without drama. Also, unlike Node and Go, you can easily hire people who can work on the code, write tests, and support the deployment and monitoring of the system. If I chose to write the same thing in Go and anything went wrong, I'm looking at getting fired, and rightly so since so much of what we produce has implications beyond the language/runtime used.

Re: Should I Learn Java in 2018

#84
post #47
post #28

Earlier quoted context omitted.

You're taking the question very literally. Implicit in it is should I learn Java over X given I'm constrained by time and opportunity cost. Yes, we'd love to learn all the things given infinite resources.

It's implicit - but my criticism here is mostly that once you know one development stack learning others is significantly easier. Learning Java is something that a backend developer can likely do in a week - and so is learning Node.js after knowing Java.

Knowledge of a language is a scale and not a binary yes / no question.

Being passingly familiar with a language is a week exercise, putting it on your resume / CV and saying you're ready to write production quality code is different.

For Java specifically:

- How does the JVM memory model and other internals work?

- How comfortable am I with the standard library?

- What are the idioms and design patterns used by professionals in Java?

- Performance pitfalls that are tribal knowledge with concurrency / threading, etc?

If the scale of language knowledge is 0-10, getting to 3, where you're familiar with the syntax, common language features and a few APIs is a week's exercise after you've used a few languages (in the same family -- I'm not going to be passingly familiar with Haskell in a week).

Re: Should I Learn Java in 2018

#85
post #60
post #22

I never got the "Should I learn X" posts. The answer is yes to all the "Should I learn X" questions so it's very hard to have a discussion. Learning another language is _significantly_ easier than learning the first one or two - not to the point of being a master but to the point of being competent. Should I learn OCaml? Yes, you learn from knowing a functional language and Scala (combines functional and OOP well) an…

Learning another language is _significantly_ easier than learning the first one or two Learning the syntax, sure. But to be productive at a commercial level in any language these days is about knowing your way around the ecosystem, libraries, tooling etc, and that takes a significant investment of time, and the knowledge is highly perishable. 3-4 languages is probably the most it’s reasonable to maintain and to claim…

> the knowledge is highly perishable.

This is a very important point: many consultants get exposure to something like that 3-4 language list but most of that knowledge often stale or biased by past projects. This frequently ends up being actively harmful if they’re recommending something which they think they understand but the weightings are no longer correct. I’ve seen that the most in web projects (“you realize we no longer care about IE8, much less 6?”) but it’s pervasive because the cost of learning any two things well enough to do a deep comparison is higher than most places are willing to pay.

Re: Should I Learn Java in 2018

#86

If you want a low stress good paid job, where you would be able to rush home at 5pm, then yes. If you are looking for excitement, learn $hype_of_the_year and join a startup, but be ready to learn $hype_of_the_next_year soon.

I work with TypeScript, Golang and Java and I find Java the most exciting. There are a few or several libraries for everything, each of them well polished, new great features coming to Java language and JVM every 6 months, great support on every platform, many build tools to choose, that are easy to use. Things like GraalVM, local type inference, Jigsaw, SpringBoot and Jenkins make Java top language you can use these days.

Re: Should I Learn Java in 2018

#87
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.

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

Re: Should I Learn Java in 2018

#88
post #32

> Should I learn Java? This is a question that just keeps coming up. Really? Java has a verbose but bland syntax, relatively fewer surprises, to 'learn' it, should be straightforward. I don't think this should pose as a problem to average dev at all.

Agree. Even if you don't plan to be an expert Java developer it is still useful to learn it, and the effort should not be huge. Especially not for someone with experience in other languages. It really isn't a difficult language to learn up to a level of basic proficiency. It should not be more than one or two weeks of effort to be able to create useful things if you know what to look for. The effort of learning new p…

Exactly. Most people are proficient in 1/2 languages maybe, but in many cases, it is pretty common to be in a situation where you need ramp quickly to just understand stuff and make modest changes to the code when necessary. Don't really understand why people seem to make a big fuzz about it like it is a huge commitment.

Unpopular opinion stated, programming language as a skill by itself will gradually lose its importance in job market. Companies, specially big ones, will hire for domain experts, rather than language specialists.

Re: Should I Learn Java in 2018

#89
post #32

> Should I learn Java? This is a question that just keeps coming up. Really? Java has a verbose but bland syntax, relatively fewer surprises, to 'learn' it, should be straightforward. I don't think this should pose as a problem to average dev at all.

Agree. Even if you don't plan to be an expert Java developer it is still useful to learn it, and the effort should not be huge. Especially not for someone with experience in other languages. It really isn't a difficult language to learn up to a level of basic proficiency. It should not be more than one or two weeks of effort to be able to create useful things if you know what to look for. The effort of learning new p…

But learning the syntax is only a small part of learning a language. Knowing your libraries is a huge part of being productive. How do I do rest queries, cryptography, filesystem manipulations, serialization, spreadsheet manipulations, images manipulations, web frameworks, interaction with the OS, multi-threading debugging, UI, etc. Outside of staying within an ecosystem (JVM / .net), you need to rediscover all these from scratch, get bitten by all the gotchas, etc.

Re: Should I Learn Java in 2018

#90
post #19

if you learn Scala, you'll learn also Java as side effect

SBT is hellish though and the added complexity that Scala has imposes a lot of cognitive overhead. With Kotlin, you always end up writing cleaner Java and don't risk erring on the side of unneeded entanglement in the spaghetti monster that Scala can sometimes be.

> SBT is hellish though

Agreed, ignore it, stick with Maven.

> the added complexity that Scala has imposes a lot of cognitive overhead.

That's just FUD and memes. Scala is more consistent than Java and much more consistent than Kotlin, which makes it much easier to concentrate on what your code is actually doing.

(This is why you will see some very complicated functions and datatypes written in Scala - it's only really practical to write a complicated function or datatype in a simple language, because otherwise the language will sap too much of your attention. But that's a reflection of those functions and datatypes; if you don't need a complicated function or datatype, don't use it. The language itself is simple)

> With Kotlin, you always end up writing cleaner Java and don't risk erring on the side of unneeded entanglement in the spaghetti monster that Scala can sometimes be.

Not true. Kotlin codebases that do the same thing look worse than Scala codebases or have subtle misbehaviours waiting; Kotlin has a huge number of ad-hoc special cases e.g. nullables, async, continuations are all special language features. Kotlin's ability to do error handling/validation is actually worse than Java's (no checked exceptions and no adequate replacement if you want to actually report the details of failures).

Post reply on HN