r/learnjava • u/aleesssa • Nov 25 '20
why do people hate java so much?
why do people hate java? I personally really love java because of the OOP paradigm and it makes my codes cleaner. not to mention the portability. but i swear I see more than one tweet hating on java everyday, or saying java is dying. is java really dying?
I guess I have two questions; why do people hate on java and is there still a future for java?
27
u/Koyomii-Onii-chan Nov 25 '20 edited Nov 25 '20
There are arguments for the "hate" Java gets but it's not a generalization, people hate C/C++/Python/.Net/JS for reasons as well because people are by nature haters
There are Linux devs that only like stuff in C, there are windows devs that only like stuff in .net etc. Refusal to accept that a language can do different things is one point
Java can be confusing, for example: what is the difference between JSP, JSF, JavaEE, JPA, Spring, SpringBoot etc. These frameworks / libraries / technologies can be confusing as hell for a beginner
Legacy code and xml hell. Before we had Annotations that simplify the work of configuring beans we had something like
<bean id="country" class="org.arpit.java2blog.model.Country">
<constructor-arg index="0" value="India"></constructor-arg>
<constructor-arg index="1" value="20000"></constructor-arg>
</bean>All cool and simple if you read a little about spring. Until you apps becomes 200 classes and your xml configuration is a sea of hopeless text
4) Too verbose
Python:
print "Hello"Java:
public static void main(String[] args){
System.out.println("Already bored!");
} is there still a future for java?
Java won't go anywhere anytime soon so if you are asking if it's ok to learn Java the answer is yes. In 2020 we have better IDE (and I refer to Intellij, God help the ones with eclipse or netbeans) better frameworks and a lot of learning materials
13
u/aleesssa Nov 25 '20
(and I refer to Intellij, God help the ones with eclipse or netbeans)
haha, totally agree with you! i tried eclipse once, and god i hate it.
thanks for the answer, those make sense
7
u/thechexmo Nov 25 '20
Eclipse is powerful, but it'd take you a life to learn how to use all its powerfulness. I tried to, and I got some fun... But in production it makes you waste time IMHO. I know some mates that "understands" the environment and they get good juice of it, tho.
NetBeans is friendly, specially for newbies. A lot of people starts with it and then you may get stuck to it for a long time. I don't personally use NetBeans so much, but i like it.
IntelliJ is smart. Literally some features are designed as intuitive as like someone is reading your developer's head. In contrast to NetBeans, I wouldn't say IntelliJ is friendly to newcomers because I feel it's counterintuitive for them. And i don't like the freemium philosophy that resides underneath the surface of the environment.
I believe each one has its own scope, so there is no thing such "this one is better for everything"
4
u/Hioneqpls Nov 25 '20
I'm biased since I've only used IntelliJ, but god damn what a fanstastic IDE. I see no reason not to use it. If I were ever to teach someone Java from scratch I'd have them use it 100% of the time. Even if they don't learn how imports work. Show em how to code instead.
1
u/thechexmo Nov 25 '20
As like a survey:
Would you pay Jetbrains for features that are free in other software?
There is no right answer, i'd like to know.
2
u/Hioneqpls Nov 25 '20
Yeah, software engineering pays handsomely and I would do it to support further development. Also their support is open to everyone without user registration and at least when I tried it I got a reply within 4 hours.
1
u/HecknChonker Nov 25 '20
The community edition is free and has most of the features you need. And if your are working in a professional environment then you don't have to pay for it because your employer will.
0
u/thechexmo Nov 25 '20
Maybe in your locale, but thinking worldwide this isn't as straightforward as you say
3
u/Alwayswatchout Nov 25 '20
Ngl im using eclipse as a learner to java because IntelliJ is soo complicated. There's waaay too many functions lol
1
u/HecknChonker Nov 25 '20
IntelliJ is absolutely the best java IDE currently. I've used them all, and the others just don't compare. IDEA helps you write better code with less effort than the rest.
1
3
Nov 25 '20
I came into java as a beginner, and got the grasp of programming through the java basics. But man Spring was too much of a challenge to get into as a fresh programmer. I'm sure now I could work with it but even still it's not the easiest thing out there.
And your 4th point is exactly what I was going to write. It's just long. Isnt a flaw, but still. Thank god for the 'sout' shortcut in IntelliJ
Good luck OP! Every language has its haters, but if you're enjoying it, that's all that matters
1
u/aleesssa Nov 25 '20
thank you! I bought a course on java because I fell in love with it (java) and wanted to properly get to know it, but some people are really making me question my decision lol. but yeah, you're right, if I enjoy it and it fits my needs, there's no problem
1
u/Koyomii-Onii-chan Nov 25 '20
I recommend the udemy course: spring and hibernate for beginners by Chad Darby. It get you through all Spring from the very basics and multiple Spring projects( MVC, Security, AOP) and later a little spring boot. It's not advanced but perfect to get you started
2
u/jabbalaci Nov 25 '20
In your Java code, you forgot the surrounding class. It's more verbose than your simplified code.
1
u/popey123 Nov 25 '20
Hi, i m using netbean and i would like to know about i ntelliji
3
u/desrtfx Nov 25 '20
Just try it. The Community Edition is free: https://www.jetbrains.com/idea/download/#section=windows
1
u/Hioneqpls Nov 25 '20
But c'mon man every chad Java dev just slaps on an @Slf4j and uses console.log("😎");
1
u/listendudeheylisten Nov 25 '20
Serious question. Why does nobody mention vsc as the ide of choice when it comes to java?
1
u/Koyomii-Onii-chan Nov 25 '20
At my company we have projects that use vsc when developing single page apps with angular / react in a combination with other ide for java. I am not an expert in vsc and I don't know what facilities it has but I doubt it stands near intellij when it comes to it
1
u/nekokattt Nov 25 '20
Honestly from experience, compared to Eclipse and IntelliJ, VSC's Java extension seems to choke on projects that have a large number of dependencies. Working with Spring Boot/Java EE projects becomes unbearably slow very quickly, at least for maven projects.
Might be a different case now, but when I tried it this time last year... I just had to uninstall that set of extensions in the end, unfortunately.
1
u/nekokattt Nov 25 '20
you forgot the frameworks like apache camel that allow you to basically write 90% of your application business logic in pure XML.
Lovely stuff to try and debug if it doesn't work. Strangely no one ever bothered making an XML debugger lol
(Big /s in that second paragraph)
0
u/Vandenite Nov 25 '20
System.out.println("Already bored!");
TBF, you completely exaggerated your comparison here. You don't need to create a class or method in order to output something.
3
u/Koyomii-Onii-chan Nov 25 '20
I have no idea what you are talking about. That is the main method, you can't have a program without it in Java, The main method has to be in a main class
If you are talking about the printing using static blocks
static{ System.out.print("Hello World"); }};then you need to tell the JVM to not check for a main method. If you are talking about applets that is a different thing but still requires a class
1
8
u/onlyforjazzmemes Nov 25 '20 edited Nov 25 '20
I personally really love java because of the OOP paradigm and it makes my codes cleaner.
I'm a student who loves Java for the exact same reason. My first language was Python, because everyone says it's "easy to learn" and "a good first language." But OOP principles just didn't click until I learned Java.
2
u/aleesssa Nov 25 '20
exactly! I'm guessing it's because python isn't completely OOP and it kinda mixes a few paradigms together. learning Java coming from python was really confusing at first because I grasped the wrong concept of OOP lol.
1
u/nekokattt Nov 25 '20
Python is technically more OOP than Java, if you strip away stuff left out because it is a scripting language.
You have meta classes, which enable everything to be an object regardless of what it is. Classes are objects, functions are objects. That is closer to true OOP than Java allows, where you have primitive value types that cannot have vtables, and elements like classes and functions can only be implicitly converted to descriptors or functional interfaces to move them around.
The issue with Python is that it is really easy to make an entire project held together by hacks because of the flexibility and transparency of everything. More often than not, people will discard good OOP practises in Python if they are not as experienced because less of a constraint exists on you to do stuff properly :)
14
u/ixBerry Nov 25 '20
I love java. I am in love with Java. Learnt a fuckton of languages over the years, but nothing comes close to being fun and useful to me personally as Java.
8
u/Farpafraf Nov 25 '20
why do people hate java?
many people use Java
Java is very verbose
null sucks
is java really dying?
lol no and even if it were to die you'd still have newer languages like Kotlin that are very similar
1
u/BoyRobot777 Nov 25 '20
Java is very verbose
Any examples?
1
u/Farpafraf Nov 25 '20
3
u/nekokattt Nov 25 '20
https://github.com/eclipse/org.aspectj/blob/master/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/HasThisTypePatternTriedToSneakInSomeGenericOrParameterizedTypePatternMatchingStuffAnywhereVisitor.java is my favourite, from the Aspect Oriented Programming library/mini language AspectJ.
1
9
u/trisul-108 Nov 25 '20
Java requires some effort to master, so it is hated by those who do not have the necessary concentration. It also tends to turn verbose, to put it in religious terms: too much formal ritual obscuring the actual prayer. Other people love rituals, so they don't mind, it gives them a sense of belonging.
4
u/sweetno Nov 25 '20
Java is verbose, people first think it's okay, but after reaching 200k lines they start questioning their sanity.
There is also this Null pointer exception thingy which is very curious in Java because there is a feeling that you see more NPEs at runtime than null pointers in your code. If null pointers were removed from the language, most of developers wouldn't complain at all.
Overall, exceptions in Java tend to come from unexpected places.
9
u/jythejavaguy Nov 25 '20
There are two kinds of programming languages: the ones everyone complains about, and the ones nobody uses.
0
3
u/OnTheGoTrades Nov 25 '20
The short answer imo is that it’s very verbose. With that said, I don’t hate it. It’s the language that helped me understand code in other languages. I think the verbosity actually helped me learn.
3
u/ozhero Nov 25 '20
If Java is dying then it has been a VERY long drawn out death lol, since it is still here bigger and brighter than ever after 25 years.
In other words people who are saying this have no idea what they are talking about.
4
u/brad_shit Nov 25 '20
My only persistent complaint is that is ugly. Definitely not my favorite language, but it serves its purpose.
4
2
u/smash_that_code Nov 25 '20
I ll give my 5 cents.
You can hate something because it is a fun. It is fun to feel that you nodeJs, C#, python, java or whatever feels superior to YOU.
But these are comments of people who search for a way to support their chosen technology.
And there are other people. Who tried java stuff, learned another languages, technologies and can provide some comparisons.
Like simple programs arr simpler in python.
It is not some random hate. It is a comment about two tools and specific tasks.
What I would call an issue with java. It is enterprise approved language therefore you can stumble upon some legacy nightmares done by people who were hmm not good at their job.
There are jokes about ExceptionFactoryFactory to generate ExceptionFactory. And from my perspective only Java had such over engineering mess with EJB2 and JSF and wsdl based web services. And people who can't stop mumbling about patterns and di containers and apache commons.
But this is still an opinion about tool for specific task.
I think it is really good idea to know when java as a tool helps you and when it should NOT be used.
2
2
u/grafcetonline Nov 25 '20
There are haters and there are lovers and since I'm language agnostic I'm neither one or the other if a project is in Java well I'll do it in Java if it is nodejs it will be nodejs :)
Java was risking to become like cobol a few years ago but now it has become innovative again with things like graalVM. It is very widespread in Big Corp so there's no way it'll disappear.
Now for newcomers to programming the learning curve may be too steep if they didn't have followed a traditional computer science degree but you have other stacks like node, php, python and ruby so why be hatefull or is it like in Religions ;)
2
2
u/mikezyisra Nov 25 '20
So far most of the complaints I have heard so far are because it is extremely cluttered and verbose, which I agree with. Also the println has no templating which is quite annoying honestly. But the language being very cluttered is frustrating. Don't get me wrong, I like Java, but the verbosity is annoying
2
u/teriyaki7755 Nov 25 '20
The only reason I would want to hate on java will be because of its verbose syntax. Rest of it is a blessing.
2
Nov 25 '20
I don’t hate Java. But it’s more verbose than any other language I’ve worked with . From what I’ve seen Kotlin helps reduce the verbosity I don’t like substantially.
It’s getting better with memory in containers which would be my next complaint.
Other than that it’s often legacy code and older frameworks in Java that bother me, not the language itself.
I can’t say I hate it but I don’t love it.
1
u/nekokattt Nov 25 '20
The memory issue is the JVM rather than Java itself. You'll have the same issue with Groovy, Scala, Kotlin, Clojure, etc if they use JVM targets.
If GCJ was still about, that would have different memory performance for Java than the JVM :)
1
Nov 25 '20
I get what you mean about the JVM. When I think about Java I rarely think of it as separate even though technically it is.
1
u/nekokattt Nov 25 '20
Yeah, most people do, some projects like GCJ did exist to try and change this though as mentioned. They just... never really took off
1
2
u/docssandra Nov 25 '20 edited Nov 25 '20
it's the #3 programming language on the TIOBE index, often considered the gold standard for program language rankings.
Not all developers post stuff on the internet, they just code, and therefore, what you hear online can often be misleading.
Spring Boot in particular has re-energized a lot of java devs and IMO has done a lot to modernize Java. Check out this graph from 2017:
https://redmonk.com/fryan/2017/06/22/language-framework-popularity-a-look-at-java-june-2017/
As to why people hate it, object-oriented programming isn't for everyone. Functional is popular again (yes, java is moving to address that as well, but it's not known for it.)
Also as a language, it doesn't move as fast as some other, more recently invented languages that might have better syntactic sugar, better this or that. great for companies who worry about backward-compatibility, but not always for devs who want built-in support for the most recent trend.
Personally, I believe that many java devs are backend focused, which can be a challenging domain in general. The library and framework the ecosystem is huge, which can be amazing (choice, opportunity) and also daunting (overwhelming number of choices/options.)
Also I agree with u/PsychedelicPistachio 's comments below.
3
u/Yamoyek Nov 25 '20
My gripe with java is the fact that it forces OOP. There is no reason that a 50 line program should be forced into a class. However, I’m still learning it (albeit not as fast as other languages) because it is one of the most widespread languages. Java isn’t dying, and I don’t think it ever will. The power of java comes from its JVM; write once, run anywhere. This is vastly more convenient than almost everything else. Why? You don’t have to worry about OS specifics. It’s also ten times easier to deploy a script like that. Until a language comes a long that has it’s own virtual machine, java will stay pretty high up on the most common programming languages.
2
u/nekokattt Nov 25 '20
technically python runs in a mini VM, as does ruby, perl, etc.
The difference with the JVM is that it is an extensible API, rather than something built for a single language only, which is why other langs like Kotlin, Scala, Clojure, etc all use it
1
u/Yamoyek Nov 26 '20
True. Every byte code compiled language technically runs in a VM, but Java’s is much more extensive, as you said.
1
u/Tomato_Sky Nov 25 '20
This was a question on my OOP final by a professor on a C++ enhancements board. “Why is Java terrible? List 3 reasons.”
I don’t know how I did because it was the final so I couldn’t see if he marked any wrong. But since then I’ve debunked most of my reasons by finding ways to do things like manual garbage collection. I don’t think he intended for me to like Java more.
1
u/moe87b Nov 25 '20
People who say they hate java never used it. People who use java now that it's listening !
1
u/Serializedrequests Nov 26 '20 edited Nov 26 '20
I'm a hater, but I like Java as far as it goes. I love the good things: portability, performance, and maven.
What I don't love:
OOP is not the be all and end all. OO designs can be very complex and hard to understand. I view a lot of classic OO design patterns as Java workarounds rather than clean code, and don't particularly care for DI frameworks as again feeling like a workaround.
Many popular Java libraries bafflingly fail to learn from other successful frameworks. For example, ask me how hard it is to get useful query logging in Spring Boot: I could write a research paper on the topic, and I still haven't figured it out (before everyone tells me the option to enable, what I am saying here is the output of that option SUCKS for debugging compared to every other ORM ever. The queries are unreadable and contain no useful metadata).
Java syntax itself is a bit off for readability. I want to read code top to bottom, and the type definitions constantly break the flow by pushing the behavior off to the right. Newer languages do this better. Likewise, I want to declare locals "final", but this results in tremendous line noise and so is rarely done.
Lack of safety, despite being compiled. "Null" in Java is a giant escape hatch from the type system and must be constantly guarded against. It is a frustrating waste of time and lines of code.
Annotation oriented code. This is what I call JPA or spring boot style code with @ on everything. This is, like null, a giant pointless source of confusing runtime errors and feels like a new passive aggressive style of coding, and overall worse than imperative coding.
Lastly, the general verbosity. I don't mean syntax, I mean the language lacks high level expressiveness so the amount of pointless boilerplate code tends to be off the charts compared to projects I maintain in higher level languages.
1
1
1
u/marjthebyrd Nov 26 '20
When I first tried it out in my computer programming class, I was taught that language along with Python. Python was significantly easier. I mean I don’t hate Java, it was just a too little complicated for me. I won’t lie, I was pretty gleeful with my first successful exercises in Java.
1
u/StrangePractice Nov 26 '20
To me, and compares to other languages, it feels outdated and clunky. It honestly seems like a language schools only use to teach student OOP. Although C# would be nice to teach as a first language too, but I’m not gonna enter that debate just now
1
u/DelarkArms Nov 26 '20
I cannot NOT LOVE Java.
I think is the way people teach OOP.
I am self taught, and I kinda see the pointlessness of some terminology like "setters" and "getters" they become useless with concepts like statefullness and statelessness, also when mixing Time you've got, cycles, you got agency...is not really about "getting" and "setting", but more about "giving", "receiving", "taking" and "getting deprived".
All these misleadings make the language so much more difficult to understand.
But not only this...
OOP is undeniably king, but it requires some other advanced design concepts to truly work at its full potential.
For example, I'm not sufficiently versed in the entire Java library, but my guess is that the Observer, Subject pattern requires a too convoluted structure, that it stales it's scalability, and it hampers its choice as a solution.
Maybe because at the version of Java that it was first developed, but, the observer pattern should not be a pattern at all... it should be an generic component (2 one for the dispatcher another for the observer), that should not require any extension.
This and other more complaints I have of Java I'm pretty sure that come from my lack of knowledge of some libraries, but the best thing about Java is precisely this.... is the fact that Java makes you have full control on the "How to", and if you develop a platform enough... you can achieve a true "What to" at the more precise and finely tuned detail there could be.
Now my conspiracy, because is not farfetched at all.
Having a language that everybody uses, will make you stupidly rich, either by saving or by selling services, so there is a financial benefit on making the competition seems as if they are dying or outdated.
You just need to create some courses on Udemy or Coursera telling everyone that your language is used by everyone and how cool and easy it is, and some mods to be constantly scanning for questions on SO.
1
1
Nov 26 '20
Java isn't going anywhere any time soon. I prefer Python, personally, due to verbose nature of Java. But that's a preference.
Java is still widely used in enterprise settings and most of those enterprise applications aren't going to be rewritten because of some other language gaining mainstream traction.
As with anything in life, don't listen to the haters. They're only regurgitating what they're feeling on the inside. If I say that I dislike Java, it's because of the extra things I need to do to get it to work as opposed to the simplicity of Python. I still use Java because it works, it's solid, very well supported, etc....all things I like about Java. People sometimes express "hatred" for things they don't understand.
1
u/swearengen1776 Dec 13 '20
Java doesn’t seamlessly integrate to the windows platform like .NET does. Even though, in the end, the VM is external to the application, the .EXE and .DLL are more seamless. Let’s face it, the vast majority of development is done on a Windows machine... at least up until a few years ago when the Mac started to challenge, and the lines were drawn. .NET is a set of seamless libraries and Java is much more fragmented. C# is just a bit richer than Java. Microsoft did an excellent job with Visual Studio and its enterprise products and that momentum has carried them through the years until now.
1
1
u/G19K97 Dec 14 '20
There are 2 kinds of developers. Those who know OOP and the others who think that they know real programming.
1
Nov 25 '20
I've learnt many languages, but I have a priority clock in my head, where Ruby is at the topmost, then next comes Rust, and Python. Because Ruby has allowed me to build something that I can call as a project (Rails app that is). Java isn't in the topmost, somewhere around position 5, but I don't hate Java. It is just that I feel like using C/C++ is a better option over any such language, cuz I have OCD for "performance", but when it comes to portability, then yes, Java does it well.
If you are able to use a language comfortably, you love it. If it feels like a waste of time, you hate it. Probably, for me, I hate MASM so much, that I won't ever touch it.
1
u/Mr_82 Nov 25 '20
Java's by no means the only OOP though, that's most popular languages. (Though maybe you mean something more specific with "OOP paradigm" here; maybe that refers to something more particular).
I think you need to be extremely experienced with several languages first before even commenting on, or being able to understand another's explanation, about how languages compare to each other (and I don't know if I'm quite there yet to remark, though I do have a decent amount of experience with a lot of the common/popular languages. For me still, there doesn't seem to be much of a significant difference between any two languages. For the most part, it would seem the industry just made several languages to try and make more money, and they've succeeded at that I suppose)
0
u/PsychedelicPistachio Nov 25 '20
Its the main language used in schools and uni's so the experience of using it for assignments makes people hate it.
Its also used for alot of data structures and algorithims like binary trees and quick sort which are boring
Also the fucked syntax
188
u/desrtfx Nov 25 '20
As simple as:
Every programming language has its haters. Java is no exception to that.
Some of the haters were not capable of learning Java, some haven't even tried, some got used to working with "more convenient" languages, and others just jump on the hate train.
Sorry for the following rude language, but it is best not to give a single fuck about the haters and to just ignore them. (In fact, quite a large number does not even know what they are talking about.)
Yes, Java has its flaws. Yet, it is the #1 enterprise programming language for exactly the reasons you mention.
Java is often considered a "boring" language - which is exactly what enterprise development needs. It is a rock solid language with a very mature, extremely huge ecosystem.
Java is not moving as fast as other, more modern, more hyped languages, which is due to the fact that Java tries to maintain as much backward compatibility as feasible and also because it has to remain rock stable. Since Java is used in absolutely mission critical programs where the smallest instability could cause huge losses, the Java maintainers decided to move slower.
Java is not flashy. It is just a silent, quite efficient work horse.
Zero reasons to actually hate Java.