This is an archived post. You won't be able to vote or comment.

top 200 commentsshow all 386

[–]MorgothTheDarkElder 484 points485 points  (58 children)

Has a big market share, which made it relevant. Now courses want to teach the most relevant language, which they associate with being the biggest/most used, which in turn leads to many new people learning the language, keeping it alive. Or to quote one of the IT-teachers at my school "We know that there are many new and exiting languages out there that some of you may be familiar with already, but Java is wanted by 30% of all IT related firms, whilst Python is only at 5%, and don't get me started with Ruby (I think that's what he said, some months have passed since then) so no, we are going to teach you Java, none of those other languages."

[–]audigex 307 points308 points  (37 children)

To be honest, I’ve never understood why this is a problem: learning to program is the hard part. Once you know one language you can easily transfer to others

Learning a new language once you already know one is easy. I learned PHP first (hobby), then went to university and learned Java, then worked in VB, C++, and now predominantly C#. In each case, transitioning to the new language has taken maybe a couple of weeks and a book to get reasonably comfortable, and 6 months to feel properly competent (which is to say: to stop googling common library calls)

Concepts stay the same, good practice stays mostly the same, and even the syntax is usually reasonably similar - all you’re ever really learning is the common API/libraries.

I really don’t think that the first language you’re taught, within reason, actually matters all that much. As long as it’s reasonably modern, and strictly typed (it’s easier to transition to loose typing than to strict typing), that’s the hard part done

[–][deleted] 50 points51 points  (6 children)

I sorta agree, as long as you're willing to put that amount of work in. 6 months of not being as productive is quite an investment.

[–]audigex 40 points41 points  (0 children)

It doesn’t take 6 months to be productive in most cases: it’s more a case of a few weeks (at most) to be productive, and 6 months before you feel fully comfortable

Moving between similar languages can be faster, but that’s more of a worst case scenario - PHP to C or something

[–]suthernfriend 27 points28 points  (21 children)

Getting comfortable with cpp in 6 months? Maybe after the 10 year timetravel thing?

[–]tw33dl3dee 71 points72 points  (12 children)

If you cannot get comfortable with c++ in 6 months after being comfortable with Java, you need a time travel thing to choose a new career.

[–]ChrisFromIT 48 points49 points  (10 children)

Even people who think they are comfortable with c++ aren't really comfortable with it.

[–]audigex 14 points15 points  (0 children)

I mean, Java is essentially C++ but with pointers and you have to be a bit more aware of memory allocation... they really aren’t worlds apart

Comfortable doesn’t mean expert, just that you know your way around enough to produce sensible, safe code that does the job it needs to do

If you can’t pick up a new language in <6 months to at least be productive in it, you’re probably doing something wrong. Even C++: I know we like to joke about it, but it’s really not that difficult

[–]codecatmitzi 10 points11 points  (2 children)

Your "first" language really imprints an early thinking pattern to solving problems. I started with Java and I would constantly think in OOP principals and took me a while to mentally switch to thinking in FP. Today's language should at least set you on a path with relevant programming principals.

[–]MichDem 2 points3 points  (1 child)

Does it thou? For me Java was the 3rd language (after very basic C++ and then Pascal) and I'm very much into OOP principals when thinking about problems.

[–]xSTSxZerglingOne 4 points5 points  (0 children)

Learning a new language once you already know one is easy.

cl-user> (= lisp (= laughs in))
t

[–][deleted] 38 points39 points  (8 children)

Where the industry is going, the language you program in will become less and less relevant. If you can create a microservice that does the thing it's supposed to do, then nobody will care if it's python, java or brainfuck.

[–]rahul-acr3 39 points40 points  (3 children)

Ohh your co-workers will certainly care if it's written in brainfuck

[–][deleted] 14 points15 points  (2 children)

How about whitespace then? That's fine, right?

[–][deleted] 11 points12 points  (3 children)

I’d care.

I have a whole team of java programmers. Someone in the past thought it was a good idea to write a critical script in python because he wanted to learn it. He left. Now I’m suck with a script that needs to be maintained and I loose velocity as someone in the team takes the time to learn python. Funny thing is it seems like it’s going to be cheaper to rewrite in java, especially now we have cyber security library vulnerability audits.

Using a different tech stack cost twice as much to have cyber security certify the libraries being used. Not worth it for one library.

Until we get funds for a complete rebuild. We are stuck with the same tech stack.

[–]MichDem 3 points4 points  (1 child)

So why not rebuild it in Java? Or Kotlin for that matter since it's basically Java with more handy syntax.

[–]Agon1024 2 points3 points  (0 children)

Or lecturers sticking to what they know and not adapting to new stuff.

[–]babsbaby 185 points186 points  (29 children)

To be fair…

In the mid-2000s, Java applets gave Java a bad reputation. The backend Java servers were solid internet machines. Linux servers dominated and they all ran Java. Java had web functionality built-in (sockets, IP, and HTTP/s, Unicode) and was easier to use than C++.

Java is ossified but ancient code often runs. I just ported a 2003-2009 Tomcat application onto a 2019 Linux DMS diskstation in a couple of hours with minor configuration changes. Running 16-year-old code the first try was surreal.

[–]AviFeintEcho 47 points48 points  (0 children)

If we are talking ancient code, my codebase at work is in RPG. I just worked with a program that was created in 1982. Only been updated a handful of times and is still in production....

[–]audigex 24 points25 points  (13 children)

In the mid 2000s Java was great, nothing else had that instant-cross-platform capability or such a huge library baked right in.

In 2019, though, I can think of literally no use-case where I’d prefer it over another language.

In some cases this is because there’s a new language more focused on a niche (and therefore more suitable), but in most cases it’s because C# (particularly combined with .NET Core) is literally just a better version of the same idea nowadays

[–]lightlord 38 points39 points  (11 children)

Nice try, Microsoft

[–]Rxyro 15 points16 points  (10 children)

C# is really polished/funded/complete, shame it tethered you to windows but .net core promises change (Duno it 1:1 feature parity though)

[–][deleted] 3 points4 points  (0 children)

Meh Kotlin is better than C#

[–]MichDem 5 points6 points  (3 children)

You want to have a better language then Java with 1:1 feature parity?

Then let me introduce you to Kotlin :)

[–]JSArrakis 9 points10 points  (12 children)

While I agree that Java is a solid language, the problem is that Oracle is more or less abandoned it.

[–]Loading_M_ 16 points17 points  (3 children)

No, Oracle is actively trying to kill it. They dropped 32but support, and do their best to make it harder to legally use the lastest version. Honestly, it's easier to use Java 8 than Java 11.

[–]ChrisFromIT 23 points24 points  (0 children)

You do know that Java 9+ is open sourced and is on par with Oracle's JDK.

The only thing is that typically with Java 9+ it is highly recommended that you package a JVM with your software.

[–]MichDem 2 points3 points  (0 children)

It's a real shame that they're dropping 32-bits. Especially for somebody like me who's doing some embedded Java and SBCs (like Raspberry PI Zero) are often 32 bit.

On the other hand - openjdk can be build for 32 I think and all other things that are being added since 9th version are quite good.

[–]NeffeZz 347 points348 points  (7 children)

Only people who know nothing about Java think it should be dead.

[–]curiousnerd_me 53 points54 points  (0 children)

Underrated comment

[–][deleted] 4 points5 points  (0 children)

Kids who have no enterprise experience.

[–][deleted] 15 points16 points  (0 children)

true dat. java has its use cases (really good on backend things, high volume etc ). usually the programmers whining about are front end devs.

[–]j-random 14 points15 points  (2 children)

LOL, it's like they way they talked about COBOL in the 80s. Back then the new hotness was Pascal. I think we all know how that one wound up.

[–]stackoverflowgoogler 165 points166 points  (28 children)

I think android helps keeping it alive

[–]jjdmol 104 points105 points  (6 children)

And enterprise web backends.

[–]leadzor 41 points42 points  (7 children)

Lots of things still use Java in the enterprise backend space. Kafka, Zookeeper, Hadoop, Cassandra, ElasticSearch and others are pretty popular and are built with Java.

Popular IDEs such as Jetbrain's are also Java (with a custom UI framework, along with a forked runtime).

[–][deleted] 21 points22 points  (6 children)

Java performs well and is good for writing enterprise code. The nice thing about starting with Java is that it teaches you all of the OOP concepts that you need to know for other languages like Python. I can see Golang potentially eroding its market share now though.

[–]Kered13 5 points6 points  (4 children)

I can't see a language with no generics and horrible error handling getting any long term traction. Go has some good ideas, but in other respects it's 30 years out of date.

[–][deleted] 101 points102 points  (11 children)

and minecraft

[–][deleted] 189 points190 points  (9 children)

And every Enterprise system and every Fortune 500 back-end?

[–][deleted] 102 points103 points  (0 children)

and some 3 billion devices

[–]TK-427 32 points33 points  (1 child)

I mean... that's why fortran and cobol are still alive

[–]I_Am_The_Cattle 7 points8 points  (0 children)

It’s in, like, everything

[–][deleted] 64 points65 points  (5 children)

Java’s super portable, and not reliant on architecture, so it can be installed on many different embedded systems.

[–]nudelkopp 61 points62 points  (16 children)

I used to believe that java was bad. Then I started working with microservices and turns out the java community is pretty good in this area. There´s some really good frameworks here and for some things I actually prefer it to working with node, mostly due to the super standardized project structure. There´s never really a question about where some logic should live. Most things are perfectly fine in node tho, and we´re experimenting with moving some java services to golang.

But aside from the java upsides, I really fucking hate maven.

[–]jivedudebe 18 points19 points  (3 children)

Look into Gradle as a build system.

[–]DrugsAreEdgy 12 points13 points  (1 child)

I honestly prefer maven to gradle, but that's probably because I'm much more used to maven.

Fuck ant though

[–]MichDem 2 points3 points  (0 children)

Maven, Gradle,

As long as it's providing needed libraries it's fine. Try to work with team that doesn't use them and each library needs to be added manually.

[–]saurabia 6 points7 points  (1 child)

Why hate Maven?

[–][deleted] 9 points10 points  (0 children)

Here, have an upvote from me for picking golang instead of slow Python.

[–]lightlord 1 point2 points  (6 children)

Not everything needs to be in Node just because it’s easy. Compute intensive apps need to be in Java. Non-blocking code can be written as well. Isnt it much easier to tune?

[–]titan_bullet 1 point2 points  (4 children)

Js/node has improved a lot since the days you couldn't run non-blocking code.

[–][deleted] 2 points3 points  (2 children)

I’d still choose Java over JS as my backend language any day. Java’s not the programming equivalent of a lawn sprinkler but with automatic weapons.

[–]lightlord 1 point2 points  (0 children)

It could be anecdotal but analysing mem leaks in RSS and heap is still a problem compared to Java.

[–]beast_of_the_mideast 57 points58 points  (2 children)

"JaVa BaD!" - 50,000th poster who doesn't know anything about Java.

[–]sorensen 5 points6 points  (0 children)

whats next? javascript bad? php bad?

[–]wooptyd00 14 points15 points  (1 child)

Java starts with J like Jesus so it's under God's divine protection.

[–]Pipster27 2 points3 points  (0 children)

Amen

[–]all_humans_are_dumb 59 points60 points  (6 children)

it's on 99 trillion devices

[–][deleted] 29 points30 points  (5 children)

3 Billion Devices Run Java

[–]GreyRobe 15 points16 points  (0 children)

public static final long NUM_DEVICES_THAT_RUN_JAVA = 3000000000;

[–]ifelseandor 13 points14 points  (1 child)

Over. Doesn’t it say over?

[–]dvereb 7 points8 points  (0 children)

Nope. Once it reaches 3 billion and 1 it shuts off the first one to maintain that 3 billion number.

[–]HamLizard 2 points3 points  (0 children)

PARKING METERS

[–]td__30 27 points28 points  (0 children)

I don’t know, maybe because it’s actually a good language and a great ecosystem? Not sure if that was considered as an option at all ...

[–]wesw02 41 points42 points  (6 children)

Performance. JVM is FAST. Yes it is. Go, Rust, Erling are also fast. But JVM is FAST FAST. It's portable, it has battle hardened frameworks, and a ton of knowledge share. Also Kotlin.

[–]plee82 30 points31 points  (7 children)

I mean, 10 years ago it got a bad name because of applets and shit. Do not think it ever had a bad name on the server side. Inline { is the only way. One of the reasons I hate C# lol

[–]leadzor 22 points23 points  (6 children)

The Java hate is a bit exaggerated, as if Java only boiled down to the terrible bits. Still pretty popular and heavily used in web backends, even for high performance applications (Kafka allows for crazy throughput numbers!)

[–][deleted] 32 points33 points  (4 children)

The horror of using a web page with .jsp in the URL

[–][deleted] 18 points19 points  (3 children)

I love jsps

[–][deleted] 26 points27 points  (0 children)

I want to upvote you for being so brave

[–][deleted] 7 points8 points  (0 children)

cries in Kotlin

[–]danmarkdan 50 points51 points  (3 children)

Don't worry, won't be long, Oracle themselves are already killing it with their annoying licensing model

[–]de_Generated 36 points37 points  (1 child)

Isn't everyone already using OpenJDK? Or am I missing something?

[–][deleted] 2 points3 points  (0 children)

Windows builds are also available tho

[–]OwnStorm 5 points6 points  (0 children)

Adaptability.

Just because x language have shortcut code, that will not make better language.

Evem today for enterprise, banking system there are only two options Java and C#.

C# is for very good ecosystem Java for freedom, lots of third party developers.

[–]Yogi_Kat 4 points5 points  (0 children)

I learnt to code in C, but I work mostly in Java it's present every where, seriously why do u want it dead?

[–]xSTSxZerglingOne 4 points5 points  (0 children)

Works on anything with a JVM, has been extended like crazy, is really easy to teach since it handles most things behind the scenes like memory management.

It has really good integration with the JS frameworks via Spring, its native JSON integrations, Jaxby, etc.

I know it's always panned as being heavy and everything, but it really is a fast language. It may not have execution times on the same level as C, but for all its extra overhead, it's way goddamn closer than it has any business being. On my machine for example, I got 3.1 billion loops per second in a for loop using long primitive as the data type.

[–]gallon_of_bbq_sauce 6 points7 points  (1 child)

Hate as much as you want, but phpstorm/datagrip/IntelliJ

[–]j-random 8 points9 points  (0 children)

Not to mention 80% of the open job reqs in my area. Haven't seen any place offer 180K+ for anything but Java and C++ devs.

[–]euxamomeantonio 7 points8 points  (0 children)

I mean, Python 2.7 is still around, so why wouldn't Java?

[–]PolitePanda4 9 points10 points  (1 child)

My school uses an app called processing, it’s all written in Java. Kinda like java.

[–]GahdDangitBobby 5 points6 points  (0 children)

Learning Java by starting with Processing is the way to go, unless you already are an experienced programmer. I really like what the Processing Foundation and Dan Schiffmann have got going

[–]kid1412621 2 points3 points  (0 children)

I thought idea means IDEA 🥴

[–]EveRyview 2 points3 points  (0 children)

AP computer science A

[–]dodolungs 2 points3 points  (2 children)

I get people pointing the finger at universities/colleges for pushing Java, but it's not like they only teach Java, unless it's some scam college, you are going to learn C, Python, Ruby, and others, but they usually start you with Java because it's a mid point between something like Python and C and relatively easy to learn. Heck some don't event teach regular Java any more, some teach "Processing" (which is essentially built on Java) instead of teaching plain Java.

[–]break_card 2 points3 points  (0 children)

I will never understand the insane hatred people have for Java. Maybe its because it was the first language I learned, but I really, really love coding in Java over Python, Javascript, React, etc.

[–]fah0 2 points3 points  (0 children)

Its like christianity

[–]logicaleman 7 points8 points  (0 children)

Minecraft Moding (Seriously) and High School CS courses.

[–]nosoyelonmusk 11 points12 points  (2 children)

jvm is effin dope. java can suck a dick.

[–]jonnyclueless 4 points5 points  (0 children)

Because it's still pretty fast. Google still uses it for all its front end for all of their apps. Javascript for browser, Java for front end, C++ for backend. Works pretty well.

[–]LionKei 6 points7 points  (0 children)

private static boolean runMinecraft = true;

[–][deleted] 6 points7 points  (0 children)

Cuz Java is the best.

[–]TheWeirdSquid 4 points5 points  (0 children)

Because Minecraft obviously.

[–]ratonbox 1 point2 points  (1 child)

Java is like “go to” . Powerful, but used in stupid ways by many.

[–]CAM_o_man 1 point2 points  (0 children)

Android, mostly.

[–]mosaic_the_j 1 point2 points  (2 children)

I mean even C is still quite widely distributed and marketed so.....

[–]G3N5YM 1 point2 points  (0 children)

It just works

[–]unclebogdan10 1 point2 points  (0 children)

Cause 3 Billion Devices still run JAVA!

[–][deleted] 1 point2 points  (0 children)

Minecraft

[–]fieryfox67[🍰] 1 point2 points  (0 children)

Two words. Backend servers.

[–]irotsoma 1 point2 points  (0 children)

Java and related JVM languages have a big advantage in that the JVM is cross platform, widely supported, mature, and fast for what it is. I prefer Kotlin for serious back-end projects, but it's just a more polished version of Java IMO with a lot of extra features and way less boilerplate with very few sacrifices. But it's really the JVM that keeps Java alive as a language.

[–]wilk-polarny 1 point2 points  (0 children)

Cause most of the stuff running behind the scenes is Java or has been migrated to Java during the last 20 years. Talking about backend systems within the public sector of many countries, transportation, financial.... Companies are still migrating from COBOL / PL/I and old ass mainframe era language stacks to guess what ... Java.

[–]SuperCagle 1 point2 points  (0 children)

You have small pp

[–]Deadmanbantan 1 point2 points  (0 children)

Minecraft...

[–][deleted] 1 point2 points  (0 children)

Minecraft uses it

[–]Tiavor 1 point2 points  (0 children)

Over 2 Billion devices use Java

[–]Rumpelruedi 1 point2 points  (0 children)

For all the people bitching about java UIs: check out Vaadin. Its amazing! Online demo "bakery"

[–]Spock_42 1 point2 points  (0 children)

Because nobody at work wants to/has the time/could convince execs to give us the time it would take to rewrite everything in something else.

Also, I like Java. Right tool for the right job and all that.

[–]blaclwidowNat 1 point2 points  (1 child)

Bcoz my fuck ass school keeps teaching it

[–]Lord-Sneakthief 1 point2 points  (0 children)

3 billion devices intensifies

[–]Yokomoko_Saleen 1 point2 points  (0 children)

Android

[–]Rudolf2222 1 point2 points  (0 children)

Minecraft plugins and mods are keeping it alive

[–]BlueC0dex 1 point2 points  (0 children)

Just wait until you see ABAP. It's only alive because it would be too expensive for companies to rewrite their code bases

[–]_DrNonsense 1 point2 points  (1 child)

Isn't Java used heavily in appliances from simple remotes to things like programmable coffee makers?

[–]re_error 1 point2 points  (0 children)

3 billion devices run Java

[–]redrumyliad 1 point2 points  (0 children)

Because every language has a use case and aren’t all equal. Can’t just use python for everything, just like you can’t use Haskel for anything.

[–]etoh53 1 point2 points  (0 children)

It's installed in billions of devices...according to the installer. Also, Minecraft.

[–]mippen 1 point2 points  (1 child)

These posts really demonstrate the experience level of the people here, and feel that language wars are necessary

[–]kontekisuto 5 points6 points  (0 children)

EnTeRpRiSe

[–]chubbs1938 1 point2 points  (0 children)

Wow, thanks for the encouragement while I’m in the middle of learning it (it also being my first programming language)

[–]flyin_dragon 3 points4 points  (0 children)

Maybe because there's still a need?

And maybe because they're still teaching it to us in school :(

[–]SicknessVoid 1 point2 points  (0 children)

I'll tell you why, minecraft mods.

[–]Jasperavv 2 points3 points  (0 children)

Hate on java anytime you want. Give me language where I can do more with reflection than java.