Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I am learning Java. I started liking it but after seeing the questions that have been asked here and on stack overflow I came to know that Java is slow and most of the people (programmers) here hate it.

What should I do now? Am I on wrong way? Shouldn't I get too attached with Java and just learn some good concepts and then move to some other language or go deep in it?

share|improve this question

closed as off-topic by MichaelT, Dan Pichelman, GlenH7, Michael Kohne, Ozz Aug 16 '13 at 9:52

This question appears to be off-topic. The users who voted to close gave these specific reasons:

  • "Questions seeking career or education advice are off topic on Programmers. They are only meaningful to the asker and do not generate lasting value for the broader programming community. Furthermore, in most cases, any answer is going to be a subjective opinion that may not take into account all the nuances of a (your) particular circumstance." – MichaelT, Ozz
  • "Questions about what language, technology, or project one should take up next are off topic on Programmers, as they can only attract subjective opinions for answers. There are too many individual factors behind the question to create answers that will have lasting value. You may be able to get help in The Whiteboard, our chat room." – Dan Pichelman, GlenH7, Michael Kohne
If this question can be reworded to fit the rules in the help center, please edit the question.

Java is an excellent language to start out on because it forces you to adopt several key mindsets when working with code, one of which is remembering what types your variables are. It is not slow. Compare Java and Ruby and you'll see what slow is. –  Josh K Oct 3 '10 at 0:23
Can you point out the questions which led you to 'know' that Java is slow? As Jim Leonardo points out, most such opinions are always contextual (or plain wrong) - and cannot be generalized. –  talonx Oct 3 '10 at 3:16
@Chankey - The first link is a question on this site - please see the answers to that. The second link is a google search - doesn't tell you anything - because similar results would come up for most other popular languages. The third link is 5 years old - the improvements in execution speed since then have been staggering. The fourth link is again old - it's Last Modified header shows 2005. –  talonx Oct 5 '10 at 15:09
Errata to the above - the 3rd link is about what the poster personally dislikes about the language's features - not about speed. Btw, I've been using Java for 8 years - with other languages. I think the question of whether Java is 'slow' these days has already been answered well - multiple times - in various forums including SO. –  talonx Oct 5 '10 at 15:26

13 Answers 13

up vote 24 down vote accepted
  • Java is not slow.

  • Even if it's not my favorite language, I like it some times. A thing that I like with Java compared to C# is that it's a smaller language.

  • Even if it's not my favorite language, it's a language good to know. The family with similar languages e.g. C++ and C# is huge and is very common in the industry. It's most likely that you will work with one of these languages if you work with programming.

  • There will be a lot of job opportunities if you are good in Java, for sure.

  • It's good to know more languages, specificlty languages that uses different paradigms. Go on, and learn.

share|improve this answer
+1. My thoughts exactly. Well, not exactly, but very close. ^^ –  gablin Oct 2 '10 at 20:21
Another + for Java: the documentation is pretty solid. Having worked with ruby + rails, I'll say that that's not trivial. –  Fishtoaster Oct 17 '10 at 15:52
Jonas, what do you mean by "smaller"? Do you mean the available functions or the runtime env./framework? –  Mark C Oct 17 '10 at 17:35
@Mark C: No didn't mean the framework or the runtime, just the language. It's a smaller language with fewer language constructs. See Language construct. –  Jonas Oct 17 '10 at 18:42
Java itself is not slow, but Swing is extremely slow. –  Billy ONeal Oct 21 '10 at 22:59

Welcome to the internet!

If no one complained about something as widely used and supported, then I would be very concerned. It's like windows: some people hate it and call out all its flaws while often failing acknowledge the flaws of their preferred OS. Some people wouldn't work with something else, but they'll still complain about using it. If we waited around for the perfect programming language, we'd still be using an abacus.

There are projects for which it is not the best option. There are projects for which it is a terrible option. But it is often a very good option for quite a wide variety of projects. So, under the principle that it is far better to know a few tools very well than a lot of tools very shallowly, it is a good choice.

Performance is terrible? AFAIK, Apache Cassandra is built entirely on java and that's good enough for Facebook, Digg, Twitter, and so on. I've generally had bad luck with performance on desktop apps in Java (and I think that's changed), but for other purposes, it seems rather ok.

And no, I'm not just a Java fan boy. What's paid my bills for the last 7 or so years is almost entirely .Net.

share|improve this answer
So you're a Java and .NET fanboy! –  Mark C Oct 17 '10 at 17:36
+1 - Java and C# are so similar... they're almost the same language :P I think it's funny that there's such the bitter rivalry all the time. –  Billy ONeal Oct 21 '10 at 23:10

There are only two kinds of languages: the ones people complain about and the ones nobody uses.

-- Bjarne Stroustrup, creator of C++

share|improve this answer
+1 for a quote which applies quite well to the original question :) –  Billy ONeal Oct 21 '10 at 23:05

Your first language won't necessarily be your last, so it is not like you are really locking yourself in with the decision to learn Java.

That said, any job board search will quickly tell you that there is plenty of work in Java programming. I think it is more a determinant of what type of product you will be working on. For example, commercial software products seem to more commonly be written in Java especially for startups. The cheaper licensing compared to the Microsoft Stack is a big draw for cash strapped startup companies. Microsoft development technologies, however, seem to dominate a lot more when it comes to internal systems development.

Ultimately I think you are best served by experimenting with a few platforms and picking the one you enjoy working with the most. You'll find work either way, and whether it is slow or not is probably somewhat irrelevant. Java is in no danger of being phased out for anything but newer versions of Java in the foreseeable future.

share|improve this answer
+1 for "try multiple languages" bit :) –  Billy ONeal Oct 21 '10 at 23:12
  • Java is comparable in performance to C/C++ and in some cases faster than those languages.
  • Java is the most popular language used by software developers according to http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html. Don't take my word for it just search for Java job postings on websites.
  • Java VM supports many different languages that run on it so learning Java gives you a great foundation even if you want to use another language: Scala, Javascript, JRuby, Clojure, etc.
  • Companies love Java, and they love Java programmers: they're easy to find, fairly easy language to learn so easy to train someone, and a very productive language.
  • Java is cross platform so you can develop with it on many different platforms which makes you more adaptable to would be employers.
  • Java and C# share so much it's very easy to move between the languages without significant retraining. You might be significantly annoyed at using Visual Studio, but ReSharper exists thank god.
  • Java has a very robust community with the open source and commercial vendors. Open source innovation has historically started on Java then ported to other platforms (e.g. Lucene, Spring, Hibernate, Log4J, etc).
  • Java allows you to deploy to many platforms like low cost alternatives like Linux.
  • Only Java and Python can be run on Google App Engine.
  • Java is one of the 4 languages Google has standardized on.
  • Java powers many large scale websites: LinkedIn, GMail, EBay, Amazon, Hi5.com, Google Ad words.
  • Java is a safe language where things like buffer overflows, heap overflows, etc can't happen. And after 15 years of scrutiny it's by in large held up to most security attacks. Other VMs haven't been so fortunate. Contrast that with Flash VM which has had multiple exploitable zero day vulnerabilities over the last few years.
share|improve this answer
Nice! Thank you. –  Chankey Pathak Oct 18 '10 at 3:05
Please provide a citation for where Java is faster than C or C++. Did you mean faster to write? –  JBRWilkinson Oct 19 '10 at 20:46
@JBRWikinson: Chubbard is probably referring to HotSpot, which spends more time optimizing commonly used sections of a program. That advantage is less nowadays with Profile Guided Optimizations implemented in most C++ compilers, but for general number crunching it's possible. That said, some things in Java are MUCH slower than their C++ counterparts, such as, oh, anything to do with GUIs. –  Billy ONeal Oct 21 '10 at 23:02
Umm the only reason that was the case was because Java did software rendering up until 1.6. Now with the OpenGL pipeline that's not the case it uses the exact same hardware acceleration C has enjoyed for quite sometime. The differences between Java and C in performance are greatly over exaggerated especially when people choose to use apple and oranges comparisons or swag examples as your GUI comment shows. –  chubbsondubs Nov 5 '10 at 16:30
I usually do run hundreds of iterations of Mandlebrot sets in my every day application writing. This is why these comparisons are ultimately fruitless. –  Jordan May 12 '12 at 21:11

Java is the most popular language in the industry. Learning it definitely gives you a better chance at getting a job, but that all depends on what job you are going for.

share|improve this answer
I agree with the second part - learning Java (and various targets that you can make with it) will improve your employability. Whether or not its' the number one favoured by industry depends on the industry and who you ask. –  JBRWilkinson Oct 19 '10 at 20:45
Wrong. False. Incorrect. Learning Java will no guarantee a job. Nothing can except for a contract. –  Dynamic May 12 '12 at 20:57

Why are you learning Java?

If it's to have a good general purpose language to have in order to find work and stay employed - there is plenty of Java work out there and probably will be for some time.

Once you have it in your skill set, there are many directions to go. You could learn C# with similar syntax to allow you to also work in the Microsoft world; you could learn a scripting language, web framework, or backend enterprise framework....

As for the speed of execution - there are enterprises out there using Java to process huge amounts of data (text and binary) every day - and it's doing just fine. It scales with hardware, memory, etc. - no problem (we as programmers can screw it up, but that's another story). I think execution speed used to be a problem in the beginning (late '90s?), but they've been working on the JVM to increase the speed for some time. The stories from the past about speed seem to hang around...

share|improve this answer
+1: IIRC the slow bit is a carryover from the early days when Java was interpreted and not jitted like it is now. –  Steve Evers Oct 3 '10 at 7:13
@SnOrfus: <pedantic> Java has never been interpreted, the bytecode has been though. </pedantic> Java is quite fast for most applications nowadays. Startup time is the real killer though :( –  Billy ONeal Oct 21 '10 at 23:11
@Billy ONeal; yes. Thanks for the clarification. I had forgotten the details of how it worked back then. –  Steve Evers Oct 22 '10 at 17:24

Languages are like relatives.

People love to complain about them, but that's what they stick with.

share|improve this answer

Spend more time hanging out places where people like Java, such as http://www.javaranch.com where they welcome beginners and experienced java programmers alike.

If you're going to master something - and Java is worth knowing at least as another tool in your toolkit - you gotta associate with positive happy productive people already doing it.

share|improve this answer

Simply saying "Java is slow" means nothing. To be able to say whether Java is slow, fast, or somewhere in between, you have to define what you mean by "slow" (and, though to a lesser extent, what you mean by "Java"). You also have to define what sort of tasks you're interested in looking at, and what sort of environment you're comparing.

Without that, people claiming either that "Java is slow" or that "Java is not" slow!" are right in the same league with a couple of three year olds, one saying "You're ugly" and the other replying "Am not 'cause you're stupid."

share|improve this answer
+1 -- Java is fast for "number crunching" -- it's really slow for anything GUI related though. –  Billy ONeal Oct 21 '10 at 23:05

It can't be that unpopular. It's ranked #1 in popularity on the TIOBE Programming Community Index for September 2010.

share|improve this answer
Do note that the TIOBE only lists what it can see, not everything in existence. Its good for a general idea, but when the numbers get close (Java and C), then you can say their pretty much equal –  TheLQ Oct 3 '10 at 13:03
I definitely agree. –  Nick Oct 4 '10 at 3:56
Also note about TIOBE: 1. It's based on internet mentions, not actual amount of code in use, 2. It's a popularity contest. Just because a language is popular, does not mean that those using it like working with it. Sometimes you just have to work with an existing large codebase of that size. –  Billy ONeal Oct 21 '10 at 23:01

Java is good with a good job opportunities too.. Java is being evolving, I don't think it gonna die soon!

share|improve this answer
>>You saying "Its not gonna die soon" is like an indicator that it will die in few years :P –  GoodSp33d Oct 18 '10 at 8:53
Look, we cannot adjudge the future, we only say we wish - according to current behaviors - that Java will stay longer than other languages. –  Muhammad Hewedy Oct 18 '10 at 12:17
Mohammed: What "current behaviors" are you referring to? I would personally say that C has a much smaller chance of being replaced than does Java, particularly given the recent acquisition by Oracle. In fact, pretty much any standardized language has a better chance of survival simply because it's legal to implement that language without fear of patent lawsuits (cough Oracle v. Google cough) –  Billy ONeal Oct 21 '10 at 23:03
@BillyONeal Java now is @ everywhere, I consider it a de-facto standard prog lang for nowadays! –  Muhammad Hewedy Jan 3 '12 at 22:23
@Muhammad: That's nice that you consider things that way. Unfortunately, that's not how it is. –  Billy ONeal Jan 3 '12 at 22:59

I love Java. Its hard to beat the on-line community, IDE support, many many libraries and excellent documentation of the language. Makes overcoming new challenges much easier and enjoyable when it takes such a short time to figure out how to do something.

share|improve this answer
That's nice, but what does that have to do with the question? :) –  Billy ONeal Oct 21 '10 at 23:13

Not the answer you're looking for? Browse other questions tagged or ask your own question.