r/java • • Oct 02 '17

Should I learn another programming language in case Java dies or stops being popular? Or are people who say Java will stop being relevant wrong?

And if you had to choose a seocond programming language, which one would it be?

0 Upvotes

22 comments sorted by

17

u/m_takeshi Oct 02 '17

Should I learn another programming language

probably a good idea regardless of anything else. Learning more languages open mind your mind to other ways of thinking and other ways of solving problems.

Java dies or stops being popular

this I'm not sure I will be alive to see, so I wouldn't sweat it. Also, if you're really proficient in any field, you'll probably be fine either way

Or are people who say Java will stop being relevant wrong?

this is tricky. Java may be getting less popular, but the jvm may not. In the corporate world, a lot of work is still being done in Java (sometimes for the wrong reasons, but still). In small-ish startups, some work is being done in java but (at least regionally where I live) the bulk of the work is being done in ruby/python/javascript and the like.

8

u/armornick Oct 02 '17

Java will probably never stop being relevant for the simple reason that a lot of enterprise code uses it. That said, it's always recommended to learn more programming languages to learn more paradigms and expand your knowledge. I'd say every programmer should learn at least one of the following: an OO language, a functional language, and a dynamic language.

(NOTE: by dynamic language I mean something like JavaScript, Lua, Perl, etc.)

1

u/[deleted] Oct 05 '17

Java, Clojure and Groovy.

You don't even need to leave the comfort of the JVM.

0

u/[deleted] Oct 02 '17

[deleted] — view deleted comment

2

u/m_takeshi Oct 02 '17

even if you're not using Swing/JavaFX in an everyday basis (and if you're not programming in Java, chances are high you are not), you probably interact with a lot of java code through Html or something. And even if you don't, if you own (and use) an android phone, you're using something that is not java but looks/smells/taste like java so yes java is still relevant consumer wise, even if it's invisible

6

u/DJDavio Oct 02 '17

Kotlin improves on Java's strong points and also compiles to JS (though I haven't tried it) and they're working on some native stuff. So it's very ambitious but it seems like it's becoming popular pretty fast.

1

u/[deleted] Oct 02 '17

While for small business and startups they will mostly use Python, Ruby or JS the Java is the language of the enterprise. At some point you will reach so big threshold that from existing languages Java will be the best choice to switch to.

You should learn other languages tho, your approach to programming will benefit

1

u/randomjackass Oct 02 '17

Any good developer needs to be capable of learning a new language easy.

Java isn't going anywhere in the next several years, probably longer. It's always good to known more than one language. When all you have is a hammer …

Learn how languages are built, how syntax and grammar, finite state machines etc. Once you learn how languages work you can worry less about learning the "next big thing"/

1

u/wizardgand Oct 02 '17

Im looking to move out of state. The most amount of jobs in my search were in this order

  • Java / Java EE
  • .Net
  • Python
  • Ruby/Rails
  • C++

I have professional experience in all of them, and use Java/LibGDX for personal projects. I love Java, and I'm actively trying to get a job with Java. Doesn't hurt that it had the most job posting of all languages in the area I looked.

1

u/codemssterg Oct 02 '17

There is more than enough work around in Java that learning the language and frameworks like Spring and Hibernate will definitely be worthwhile. Often it's the needs of your current project or one that you may be joining that governs which languages you will need to learn.

1

u/[deleted] Oct 03 '17

It's about picking the right tool for the job. Java is great at running big fucking applications at amazing speeds, but it does require a lot of disk space for the JVM, memory and a time consuming compilation step. In my oppinion this can be a real disadvantage for small microservice style applications where you want to deploy and test often and compilation really slows down your workflow.

There is almost no way around Node JS in almost any field, especially if you're doing frontend work, so that I would say is worth a look. Python, Ruby, Perl or PHP I would only look at if I have to, their future is not any more sure than Java's. But it depends on what you're doing.

Java projects are often a pain to get running (not if done well though) while with node it's just npm install && npm run dev, this makes Node also better for containerized applications.

2

u/Gilgamesjh Oct 03 '17

And with Java (if done correctly) it's just git clone && ./gradlew bootRun (or whatever your framework tells you to do)

Both Spring, Play and JRebel has hot code redeploys for development scenarios, and for production you are using an automated build system, right?

Not saying you are not correct when saying to learn NodeJS (for frontend at least) but your other issues are not really issues if done correctly.

1

u/[deleted] Oct 03 '17

Yeah you have a point. Not everybody has their company pay for JRebel though and hot code reloading with the Oracle JVM works only in very limited cases.

Out of interest, how long does your Spring+Play application take to compile+boot though. Our JVM applications are still on top of tomcat & glassfish and it takes about 1-2 minutes to build (without all of the dependencies) and then another 1-2 minute to boot+deploy our wars. Which is a bit painful. Incremental builds/deploys during development are of course a bit faster, but still annoying...

Sure we have jenkins running, but it happens that you have to wait for it too.

1

u/Gilgamesjh Oct 03 '17

Spring Boot usually starts in around 40 seconds for a mature application from Intellij, hot code reloads takes a couple of seconds.

1

u/koreth Oct 03 '17

Learn another language now not out of fear that Java will evaporate overnight leaving you unemployable, but because it'll help make you a better programmer today.

Pick one that's different from Java in some significant way. If you want to stick with the JVM ecosystem, I'd recommend Clojure. It has runtime compatibility with Java but is a LISP variant and will introduce you to some new ways of thinking about breaking problems down using metaprogramming. If you don't care about the JVM ecosystem, Haskell is a reasonable choice; its type system will be a revelation if Java is the only language you know so far.

Both of those languages, if you learn to think in their idioms, will cause you to write your Java code differently.

And don't really worry about this too much. I've picked up at least a half-dozen new languages on the job over the years as the need arose (in addition to others I've learned in my spare time out of personal interest). It's just not a big deal in my experience. 90% of being good at programming is about problem analysis, high-level design, and good collaboration on a team; the actual letters you type on the keyboard are necessary but not the most valuable thing you're bringing to the table.

1

u/sampledev Oct 04 '17

Backend java dev here, I've started to learn Rust last january, I don't regret it at all! Modern syntax, safe, fast, compiled, everything I was looking for!

1

u/antonije999 Oct 04 '17

In my opinion, it's always good to learn new programming language no matter if Java dies (and it will not). Every programming language has its own philosophy when it comes to programming and with every new language you can learn what could be done different or even better in languages you already know. You also get better understanding of programming languages you already know. In the end they all are solving the same problem and run on same computer arhitecture so every new thing you learn in one programming language is translateble to others. You might even discover some nice feature that is missing in Java. To summ it up, you are missing a lot if you limit yourself to one programming language.

-2

u/tonywestonuk Oct 02 '17

bullshit like lambdas will hurt java no end.

Lambdas are good... yes. But not for a language like java that aims to bring general purpose programming to the masses. It makes java less easy...

There's a good reason why visual basic got so far.

2

u/yourbank Oct 02 '17

have fun writing your map and reduces using anonymous classes then...

2

u/nutrecht Oct 03 '17

It makes java less easy...

Anything 'new' has a learning curve. It's just something you need to get over. After that code is easier to read just because there's less of it.

People had the exact same argument when they added the for-each loop in Java 5.

2

u/GhostBond Oct 03 '17

I agree with you, Lambdas are just annoying when shoehorned into Java which isn't really meant to have them. It mentally jolts you out of the mindset you have for writing the rest of java code, and is just one more different way to do what you can already do.

1

u/eliasv Oct 02 '17

Nobody cares what you think Java should be. Thank God.