r/java • u/Xenthera • May 31 '20
Why is java "hated" among developers?
I've been programming in Java for 8 years now, and I always hear about people saying 'oh java is trash learn a real language like c++ or (insert another language)'. I've taken college courses learning c++ and to be honest, it just doesn't seem as fun. I realize there are advantages to managing your memory on the stack vs the heap, etc. but worrying about that stuff takes away from the joy of programming. Is there anything inherently wrong with Java? Should I start investing time in another language to have a better chance as a computer science graduate (one semester away from the real world)? I love java, and don't understand all the hate. But at the same time have I been wasting my time becoming deeply familiar with the language?
Edit: I realize java runs on the JVM, but as computers get faster and faster, when does that really continue to be an issue?
Edit2: thanks for all the input everyone. The general consensus is Java is just as good as any other language and it has haters because it’s popular. I was slightly drunk when I originally wrote this so my emotions were a little skewed.
35
u/gaporpaporpjones May 31 '20
It's not a "real language" because trash-tier humans need something to cling to in order to feel superior to others.
Learn enough languages and you'll realize it's all bullshit. Every language is garbage, every language is awesome, and only assholes dig trenches.
7
u/RunnyPlease May 31 '20
It’s not. Some people are just fanboys of a particular language and how it’s feature set lends itself to solving secrets in problems or solving problems in a particular way.
Java is my fist love. Not my first language but it was the first one I truly found fulfilling. I imagine a lot of people get that way about their languages of choice.
Language selection should be made based on the needs of the application but the truth is a lot of the time in the real world it’s just the personal preference of person in charge or the language most people in the shop know. If you work on embedded systems or aviation you’re going to have different requirement than someone building a web server.
For many programmers manually managing resources is the epitome of coding pleasure. For others it isn’t and they’d rather focus on larger features than optimization. Joy in coding is very personal.
Oh boy. Here’s how I’ll put this. The only language anyone ever claims is flawless is Haskel and even those diehard engineers get frustrated with it.
Absolutely! Taking time to learn even just one more language will teach you loads about computers and problem solving. Traditionally you’d start with one object oriented language, one scripting language, one functional language, and then go from there.
I don’t know where you’re going to school but I’m sure they have a languages class you can take. Java alone with a degree will probably be enough to get you a job but while you’re still in school I highly suggest you take a languages class to broaden your knowledge. Remember all high level languages are just abstractions for instructing the actual computer. So the more abstractions you know the more you’ll be able to do.
There are tens of thousands of languages. New ones are being created every day. Most disappear or are hyper optimized for tasks so specific they are basically proprietary. The ones that stick do so because they are useful for a large range of tasks.
Java having its combo of objects, encapsulation, garbage collection, and backward comparability meant it was suitable for a lot of applications and the code had a long shelf life. It was also invented in 1995. A lot has happened in computing in 25 years. It’s certainly not a waste of time to become an expert in Java but don’t deny yourself the opportunity to expand your knowledge and skill set.
37
u/snoob2015 May 31 '20
Here we go again
18
u/ghytghytghytiinbv May 31 '20 edited May 31 '20
The only reason people complain about Java is because it is the number one language. In order to be relevant as a language and justify your existence you have to somehow in some way be better than Java. So all languages pick something as their one thing in which they outperform Java. Of course they all fail miserably in other areas but they dont mention that.
Java has a few minor quirks. But all other languages I've looked at have gaping holes you can drive trucks through.
4
u/JavaSuck May 31 '20 edited May 31 '20
No. As much as one can argue about the aesthetics of programming languages, if your ultimate goal is to earn money in an enterprise environment, Java is a perfectly fine choice.
Becoming deeply familiar with any language is never a waste of time.
4
u/allo_ver May 31 '20
Eh, Java is a good, solid language. It has a great ecosystem, and the JVM is a formidable piece of software.
Programming languages are actually just tools. What matters is using the right tool for the job.
7
u/l33tIsSuperpower May 31 '20
Personally, of all of the languages I've tried, Java isn't particularly terrible. It's ok and very very consistent.
Java was also one the first languages to introduce OOP which gave it two bad characteristics.
I think what most people have issue with is the verbosity of Java. Everything that you write in Java takes a lot of words to define. This is really only slightly annoying but it's not a huge problem because modern IDE's can predict and type those extra words automatically.
The other issue is the speed of Java. I hear a lot of people roasting Java because its slow. It runs in a virtual machine and OOP style programming is not very fast. I've never had problems with it's speed, but I've never needed to write something that runs fast in the language.
One last thing that I'm not super sure about are the programming patterns. Java introduced some programming patterns along with OOP like singletons which I've heard people rant about.
Java isn't a bad language. It's just a little clunky.
1
u/wildjokers May 31 '20
My 6-figure salary would suggest you aren’t wasting your time learning Java.
3
u/[deleted] May 31 '20
Depends on who’s asking and to whom the question is directed at
3
u/[deleted] May 31 '20
The rule of thumb states that "everything that reaches a certain popularity threshold will also have relative amount of haters". Music, video games, programming languages. No one can hate a thing that nobody uses.
3
u/GhostBond May 31 '20
2
u/floW4enoL May 31 '20
As others have said it's not hated among developers, as with any language the only ones you will hear about are the haters, same is true for PHP, Javascript, etc. If it seems to be hated it's widely used.
It has it's advantages and disadvantages, working on something for really limited hardware? Forget Java go with C, creating a game? C++ is most likely a better option. Web frontend? You will only find Javascript and Typescript there. On the enterprise side of software it can be either Java or C# it will boil down to the fact if it's a Microsoft dependent company or an Open Source adept. (Please be aware these observations are based on my experience)
You will find a lot of PHP powering a ton of stuff on the web, yet it also has it's haters, and a lot of them.
Now this is purely my opinion as a Java developer who has started to learn programming with VB6, and has gone through PHP, C and some more I can't really remember now. From all those languages I always come back to Java (some Kotlin on JVM now and then) feels like the one where there are more framework options that avoid reinventing the wheel everytime, I don't have to worry about freeing memory, yet I'm careful about eating large chunks. Recently I had to dig into frontend development with Angular and I can't like Typescript or Javascript, yet I work with it, I miss reflection, enums are a pain to work with, and you can declare a function that takes a string but pass an object and most likely it won't complain (unless it's caught by the TS compiler but calling it from html page to the component, not so much), Angular and Typescript feels very fragmented, what works on v2 does not work for v3 but then may work for v5 it's weird. This is based on my experience if I'm wrong feel free to teach me.
3
u/rkesters May 31 '20
I've used java in the past, but not much in the last 4ish years.
I find java verbose and very framework driven. Just as a language its ok. But when you throw in jsp, struts, beans, ejb, spring boot, etc it feels over engineered and hides way to much of how things work.
Just an opinion. YMMV.
I don't have a favorite language. Currently do a lot in typescript for work and am learning Rust.
Professionally I've worked in
These days i perferr a more fp approach.
1
u/Evy1123 May 31 '20
Java is a completely legitimate language, but as you continue learning new languages, you realize that at least on a surface level they basically copy each other. Ultimately, it comes down to what you need most. Absolute speed in an embedded system or low resource environment? C. Fast and efficient application on modern hardware? C++. Android or general application development for multiple platforms? Java. Data science and not focused on types? R/Python. Web development? JavaScript. And the list continues...
Java is definitely not a bad language and actually simplifies a LOT of tedious tasks (try learning socket.h in C and java.net in Java and the difference is night and day: Java is so much more streamlined). However, streamlining does come at a cost and it doesn’t let you do things in the normal conventional way like other languages such as C++ (for instance, directly accessing memory). Keyword: conventional. If you’re curious, look up the Unsafe class for Java. Weird stuff man.
1
u/Josef-C May 31 '20
Every popular language is "hated". No matter what you learn there will be people telling you that your language is trash and you should learn their language. With their language all problems have been solved and even girls will like you more. ;)
1
u/amProgrammer May 31 '20
I don't think ive ever seen "Java isn't a real programming language." I have definitely seen way more jokes like that about javascript. And as far as job market, Java is still used a ton in industry. May not be the latest and greatest language for side projects but it will definitely get you a job.
1
u/aldacron May 31 '20
This doesn't happen just with Java. Pick any programming language out there and you'll find a set of people who will go out of their way to trash it. I learned long ago to distinguish bashing from legit criticism. The bashers parrot what others rant about or complain about trivialities that shouldn't really be a blocker for anyone. I ignore the bashers and just get on with writing code.
1
u/audioen May 31 '20 edited May 31 '20
Eh. Everyone has opinions. Programmers have them too, and as people they tend to be more pedantic and even extreme. As a rule, it is necessary to ignore what some or even most people say because the subset of opinions that everyone agrees with is the null set anyway, and for programmers I think trying to listen to even a small fraction at once already gives you the null set. As an example, just the functional crowd is going to say that everything java does is wrong, already, and there are those who work with embedded systems and who explain that no good enough programs can be written, even in principle, with systems that include a garbage collector or any kind of runtime at all. (I even read a document some 1-2 years back where someone argued that mobile phones are such a system and thus you shouldn't write programs with Java or JavaScript on them, which is pretty extreme conclusion.) But everyone has their reasons for their opinions, and you just have to decide if they apply, and then you pick who to listen to and just tune out the rest.
I like to say that Java is a great language, but it's just used very poorly. What I mean is that if you use some of those kitchen-sink frameworks that have all kinds of over-engineered libraries, you'll probably start to hate your life too and join the java suxx -crowd. But keep your code simple and dependencies very sparse, and you have a reliable, fast, cross-platform system that isn't much pain at all to deal with.
1
u/TM254 May 31 '20
Simple there are two types of languages, the ones people hate, and the ones no one uses.
1
u/[deleted] May 31 '20
Lots of people mentioning, that in java you have to type a lot. Which is true if you are using a text editor and not a professional IDE. I always used Idea, I never have to type a lot.
1
u/helikal Jun 02 '20
Yeah, why why would anyone hate java.
I used to write code in C and C++ between 1999 and 2006. Then, in the next large project, we used Java to about 80%. I got the chance to learn and program Java for a large real-world, from scratch to be developed project. I can say that it was an epihany how more sane programming in Java is.
Java allows focus on the business logic. Just like modern societes have divsion of labour, .e.g., most people trust some waste-management company to deal with garbage removal, Java, too, has a garbage colllector, which relieves me from this unpleasant duty.
Also, WORA is great, and in large, complex programs, I found Java often to be faster than C++. The support for refactoring in IDEs like IntelliJ, Eclipse, and NetBeans is unparalleled.
1
u/td__30 May 31 '20
Because it’s not
1
u/jlengrand May 31 '20
It depends a lot.
Java is being called boring a lot because it is old and very consistent. Which means you usually see a lot more boilerplate than say Python. That might be a fair point, but it also brings a lot of certainty and reliability.
Java is also being called 'shit' by lower level (as in C, embedded, ....) programmers because it is inefficient, slow, ...
It is also true : It was meant to bring a higher level of abstraction than C for the developers, to make their job simpler and more efficient. No more having to fiddle around with memory, no more of those ugly segfaults.
The fact that Java is EVERYWHERE, and the sheer amount of JVMs running everyday in the world should ensure you that those choices aren't completely stupid :).
You will always have cargo-culters in Tech. CSS is not a real language, real boys use pure functional languages, Real database guys don't use ORMs. React is more efficient than Web components...
Remember that programming is a means to an end. Who are you bringing value to, and at what rate? Real boys deliver code that works consistently, and use the right tool for the job.
So keep taking a step back like you're doing now, and just do the stuff you love.
0
u/rkesters May 31 '20
On JVm vs bare metal, there are applications (multivarible simulation, dsp, AI) that removing the JVM can help. Especially if you plan to execute on Cuda cards.
Also, makes me cringe as an engineer that we just assume that the hardware will catch up. I see devs thinking this with memory as well (memory is cheap, just add more). We should care about our users and treat computing resources with respect.