DEV Community

Cover image for Java is too old, What should you learn in 2018?

Java is too old, What should you learn in 2018?

Rajasekar Elango on October 10, 2018

Java is too old, What should you learn in 2018? Java has become legacy. It can’t evolve in to a modern language while keeping its back...
Collapse
 
martin profile image
Martin Beentjes

What task are you solving? Yes, Kotlin is fresh and new and superawesome. But Java is as well. Performance-wise it is the same as both compile to JVM.

For me there are no big improvements to move from Java to Kotlin. I prefer the more verbose way Java is doing things.

I tried to get used to Kotlin but it has a steep learning curve.

It really depends on the task that defines the toolkit being used to solve the problem.

Collapse
 
xgrimau profile image
Xavi

Additionally, I feel like a lot of the issues mentioned are already solved in new versions of Java

Collapse
 
jmfayard profile image
Jean-Michel πŸ•΅πŸ»β€β™‚οΈ Fayard

Steep learning curve?
That was not my experience.
You should be able to get starting quite easily by git cloning the Kotlin Koans and fixing the unit tests in Intellij
github.com/Kotlin/kotlin-koans

Collapse
 
silverhusky profile image
SilverHusky

Can't agree more, it really varies and depends. I prefer to stick to Java if it doesn't make too much difference

Collapse
 
okolbay profile image
andrew • Edited

this article is such a fanboi teenage view on languages, and especially java )
besides the fact that java evolves and evolve other platforms, it actually has local variable type inference, so comparison is outdated at its best. I urge you to take a closer look at Kotlin’s origins too, which is owners of JetBrains, that claimed in one of their interviews, that they would take full advantage of owning both language and IDE to make a perfect blend - might turn out to be a biased platform.

PS and yes if you haven’t heard of Lombok for java - don’t thank me, its way much more powerful than built-in Kotlin data-class ))

Collapse
 
stealthmusic profile image
Jan Wedel • Edited

Although I find fanboy teenage view a bit harsh to say, I have to agree here.

Java is actually very mature and got lots of new features in the past years.

All the same has been said about Scala when it was released and it was hyped. I actually liked it because it had some nice features borrowed from Erlang. Nevertheless, it didn’t get mainstream as Java is.

And Lombok actually pretty handy. Have a look at my article about modern software development in Java.

So, I wouldn’t burn all the Java books yet. It’s always good to have a look at new languages, even learn those languages but I’m still skeptic about if it will at some point in time take over the role that Java has right now.

Collapse
 
rapasoft profile image
Pavol Rajzak

Lombok is great, but the downside is that it is not part of the language. It's a separate project with it's own bugs and issues (especially compatibility) and you neef to enforce it's usage by IDE or Maven plugins (separate projects with their own issues and bugs).

Local variabled btw will be available in Java 11, which is still not releasef yet.

Collapse
 
khmarbaise profile image
Karl Heinz Marbaise

Java 11 has been released on 25. September 2018...

Thread Thread
 
rapasoft profile image
Pavol Rajzak

Ah! I thought it was scheduled for October. My bad! I bet everyone is on Java 11 by now.

Collapse
 
jmfayard profile image
Jean-Michel πŸ•΅πŸ»β€β™‚οΈ Fayard

it actually has local variable type inference, so comparison is outdated at its best.

That's one feature, and it's only in Java 10.
Before that is available in, let say Android, we will all be dead.

I urge you to take a closer look at Kotlin’s origins too, which is owners of JetBrains, that claimed in one of their interviews, that they would take full advantage of owning both language and IDE to make a perfect blend - might turn out to be a biased platform.

What I read from this is they have both the skills and the means to provide both a good language and good tooling support, but feel entitled to have your own opinion :)

Collapse
 
xgrimau profile image
Xavi

Exactly! I've been checking comparisons Java vs Kotlin for the past months and I always feel like they are comparing it to Java 6-7

Collapse
 
rhymes profile image
rhymes

While I was scrolling I was 99% sure you would have said something :D

Collapse
 
alainvanhout profile image
Alain Van Hout

Coming back to β€˜language’ as a metaphor, Kotlin might allow you to build concise sentences, but does not mean that it therefore allows you to better express yourself, and it does present you with a lot more cognitive load. That’s not to say Kotlin doesn’t have its merrits, but it’s a bit annoying that usually only the merrits are mentioned.

Collapse
 
erajasekar profile image
Rajasekar Elango

To me concise code always reduces the cognitive load especially during reading. You make an interesting point, but an example would help to better understand.

For e.g a code that is more concise in Kotlin but requires more cognitive load and same thing implemented in another language which is very expressive with a less cognitive load.

Collapse
 
alainvanhout profile image
Alain Van Hout • Edited

The only thing that really reduces cognitive load is less logic, while 'concise' very often tends to be an alias for 'dense', which is perhaps fun to write but terrible when it comes to maintainability. As to an example, Kotlin builds on top of java (bytecode) and as such adds concepts, which in turn add cognitive load, unless the new concepts can entirely replace more complicated old concepts (a good example of that is fat arrow functions in JS, which avoid the 'this' confusion).

As a very easy example of how extended vocabulary only adds cognitive load, I'm going to going to borrow from Ruby (sorry, guys): array.second requires you to know about and keep in mind the different variations that exist (and don't exist) in this form, while array[x] can do exactly the same at a fraction of the vocabulary.

I do agree that extra vocabulary can be beneficial, but legion people have a proclivity to extol the efficacy and delectableness of a prodigious and uncurbed patois ... at the cost of clear and straightforward language. If you know what I mean :).

edit: since I forgot to specifically answer the following

same thing implemented in another language which is very expressive with a less cognitive load.

keep in mind that it's not just a matter of implementing with less code. It also relates to having to know about the syntax concepts. There are a fair number of languages that can be very expressive indeed, if you know lots of the concepts of that language (a monad is a monoid in the category of endofunctors, and so on and so forth).

Thread Thread
 
stevenbruno profile image
Steven Bruno

legion people have a proclivity to extol the efficacy and delectableness of a prodigious and uncurbed patois

I know some of these words

Thread Thread
 
peiche profile image
Paul

Alain be like /r/iamverysmart

Thread Thread
 
alainvanhout profile image
Alain Van Hout

If that's what you got from that purposely difficult sentence then great. But using a thesaurus works just as well though ;)

Collapse
 
tedhagos profile image
Ted Hagos

+1 on this. It all depends on the task to solve.

It might also depend on what you're trying to do. If you're trying to get a job on company (in your area) that uses Java (and you happen to like Java and the company) then go with Java. If you're trying to break into the consulting gig and there's lots of Kotlin jobs, then learn Kotlin ... substitute Kotlin and/or Java for whatever language applies. At the speed of how the tech world changes, I think there's certain advantage to being language agnostic. Each of these languages reached widespread adoption for a reason

Collapse
 
maheshkale profile image
Mahesh K

Java and JVM is no longer needed to be honest. Web works just better without Java. I don't know about legacy projects. But my apps won't be running on java be it desktop or mobile. I just want to get rid of that dinosaurs. Same with .Net. It's too much for little projects.

Collapse
 
jason_espin profile image
Jason Espin

Little projects? As a .Net developer who has developed for some of the major financial institutions in the world I can assure you .Net is still very much at the top of the list.

Collapse
 
eljayadobe profile image
Eljay-Adobe

JVM platform has a lot of top-shelf language choices.

Java is a lot like C#. Java is longer in the tooth, and its stewards have been much less attentive compared to the stewards of C#.

Kotlin is a lot like Swift. However, the one downside to Kotlin in the JVM ecosystem is the developer still has to be aware of the Java peccadillos or be puzzled by otherwise surprising behavior. (Analogously, Swift devs still need to have some familiarity with Objective-C to understand some of Cocoa's peculiarities in a Swift world.)

Clojure is Lisp with Functional Programming added in. If you like Lisp, I'd think you'd find Clojure to be the perfect choice for JVM. I'm not sufficiently familiar with Clojure to contrast it to super-focused functional programming language Haskell, or "FP first" functional programming language F#. I am sufficiently versed in Lisp and Scheme to have due respect for the top-of-the-food-chain languages in which Clojure belongs.

Scala is an object-oriented language seasoned with functional programming. (For those Scala fans that may find my description to be flipflopped, I suggest you take a few months to learn Haskell or F#.)

Groovy is a kinder-gentler-friendly less fussy syntax flavor of Java. Groovy is to Java, as CoffeeScript is to JavaScript. However, the creator of Groovy jumped ship as soon as he saw Scala... so if you are leaning towards Groovy, you may want to seriously test the Scala waters before committing to Groovy. (In .NET land, Boo! is analogous to Groovy... except Groovy is a top-shelve JVM language, whereas .NET only has three top-shelf languages: VB.NET, C#, and F#.)

Collapse
 
gerbrandvd profile image
Gerbrand van Dieyen

If you want to learn to program, good to start in a language that's good for learning to program (felienne.com has quite some resources on that).
I'd agree with @tuxOr to try out different languages, not just depending on the task you want to solve, but also to broaden your point of view.

Collapse
 
baso53 profile image
Sebastijan Grabar

Use Kotlin, because compiling Java doesn't take enough time already.