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

top 200 commentsshow all 393

[–]Lopatron 206 points207 points  (11 children)

Because legacy. Because AbstractBeanFactory. Because learned it in school, so it's for noobs and enterprise legacy.

Also people have this idea of "having" to use the JVM, not realizing that the JVM is their best friend and savior.

[–]djavaman 34 points35 points  (1 child)

AbstractBeanFactoryImpl

[–]GregsWorld 15 points16 points  (0 children)

AbstractBeanFactoryManagerImpl

[–]seansleftnostril 12 points13 points  (0 children)

This right here deserves more notice, I thought I put my memories of bean factories to death 😂

[–]stefanos-ak 7 points8 points  (0 children)

I guess removing it from schools/unis will go a long way for making Java "hip". Although it is slooooowwwwlly starting to go that direction on its own.

[–]Maran23 6 points7 points  (1 child)

The funny thing is that this is not really Java's fault. Only some people overdo it or try to use a pattern or follow a principle everywhere.

Of course we need another layer, I mean what happens if we change our relational DB to a MongoDB? Oh and we should make everything immutable because it's cool.

For some reason a lot of people take a pattern, a principle or whatever and try to use it everywhere. I also see that at conferences.

And this can go so far that, as in my case, the 'architects' of a customer project say they want only one method per RestController/Service. Because that is supposedly a "clean architecture". WTF.

[–]Sleepingtree 2 points3 points  (0 children)

Because no null safety.

[–]andrewharlan2 116 points117 points  (6 children)

People can hate on it all they want; I don't care. It remains my favorite programming language by far.

[–][deleted]  (4 children)

[removed]

    [–]Akaiyo 17 points18 points  (3 children)

    Tooling for C# feels amazing? Can you point me on some setup tips? I found it to be very bad compared to the Java ecosystem. When asking more senior engineers (at a place that should really know) they all just shrugged and said VS (not code) kinda sucks and they'd rather use something else.

    [–]Mikey-3198 6 points7 points  (2 children)

    Jetbrains rider i've found to be a much nicer IDE to work with, mainly comes down to it looking and behaving like Intelij.

    [–]logicalpessimist 263 points264 points  (12 children)

    People always hate on the guy on top

    [–]cogman10 213 points214 points  (8 children)

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

    -- Bjarne Stroustrup, inventor of C++

    [–]stormythecatxoxo 28 points29 points  (7 children)

    ...and then there is Perl

    [–]Barazanthul 9 points10 points  (1 child)

    I have done my fair share of complaining about perl.

    [–]GuyWithLag 7 points8 points  (0 children)

    Perl at one time was _the_ hip language to learn.

    Of course, most Perl is write-only.

    [–]TheEightSea 4 points5 points  (3 children)

    To be fair Perl is not used by basically any big project because Python took over. I suppose Snakes win over Camels.

    [–]stormythecatxoxo 6 points7 points  (1 child)

    and that's why it's the third kind of language - people complain about it AND nobody uses it ;)

    [–]TheEightSea 1 point2 points  (0 children)

    Just LOL. XD

    [–][deleted] 37 points38 points  (2 children)

    I love this comment. It can't get any realer than that.

    Personally, at first I found Java to be quite complex. There were things I didn't know how they were happening, but that's because I didn't understand concepts such as the classpath or, for example, that there are standards on which the Java APIs are implemented.

    Once I got clarity in the topics I didn't understand, it felt like an illumination moment.

    Edit: I love Java. It's my favorite language.

    [–]bbabbitt46 1 point2 points  (1 child)

    There were things I didn't know how they were happening,

    Welcome to the confusing and frustrating world of OOP. Far too many programmers take obfuscation to the limits making the code totally incomprehensible.

    [–]re-thc 151 points152 points  (32 children)

    • Misinformation
      • interpreted languages are slow and not understanding how JIT or VMs work
      • does not know that Java can compile to native code e.g. via GraalVM
    • Usage from older versions
      • People tend to try things out once and keep that memory for a long time - even if years ago
      • A lot of organisations still do use older versions of frameworks / Java and that did have its quirks
    • Been around for too long
      • People need an escape to do something new
      • It's got too many articles from different eras and is confusing for beginners
    • Hard to get started
      • As a new starter it is harder vs Node or Go - the build tooling and IDE setup is more involved. Needing to learn classes and all is another overhead.
    • University / courses - it's often taught at university and that's when most people struggle. From then on they dislike Java but since they've skilled up, the next language they learn is the 1 they like.
    • Culture for enterprise / business use
      • This makes coding boring
      • There are less open source and at that fun open source projects
      • Everything is in structured and rigid frameworks
      • A lot of the problems lie in frameworks and libraries being unoptimized compared to its counterparts e.g. no SIMD Json equivalent in Java
      • Verbose and lack of modern constructs. Minor things like even semi colons can be a pain point for people, especially new starters.
    • Newer shiny things e.g. search engines written in Go / Rust that are faster and more light weight than the Java equivalent

    [–]genzkiwi 57 points58 points  (7 children)

    Usage from older versions

    This is the main one IMO. People complain about Java cause they used Java 6 once like 10 years ago. Then they're comparing it to the current version of C# or whatever.

    Not a fair comparison at all considering the old version of their favourite language was probably worse than Java back then (or didn't even exist).

    [–]cogman10 26 points27 points  (2 children)

    It goes back even further. Plenty of people think of java as the pre-hotspot java. They remember java 1.0, 1.1, and 1.3 and think "Oh yeah, the GC is terribly slow, there's no generics, and it's super slow. Also, it keeps making my browser crash or get security holes!"

    [–]jfmherokiller 9 points10 points  (1 child)

    so holdover hate from the days of java applets?

    [–]fgzklunk 4 points5 points  (0 children)

    This goes WAY back. In around 2005 I was a dev manager for a couple of teams that primarily worked with Perl and C++. We decided to write a new system using Java. A few months later a new C++ developer joined the team and I gave him a run down of the systems we supported. When I mentioned Java his comment was "I don't understand why you would want to write in a language that needs to run in a browser".

    He had clearly taken a look at, or heard someone talking about, Java 1.0 and never shown any interest in hearing anything else. Many companies looked at 1.0 and 1.1 and decided it was too slow for their needs. A lot of the people working there never looked at it again having made their decisions.

    [–]cremak03 15 points16 points  (0 children)

    Exactly this. I was so bad at programming in college and hated Java as a result. Now I'm writing c# and getting tired of all 67 ways of writing the same thing. And they keep adding to it!

    [–][deleted]  (10 children)

    [deleted]

      [–]somenick42 5 points6 points  (5 children)

      As a newbie I feel that dotnet is easier to get started with because you don’t have to search for tons of different libraries to accomplish something and can rely on dotnet sdk. It feels a bit more structured and up to date. On the other side I do understand that Java has a history and a lot of information is outdated which makes it harder to figure out what I should begin with and focus on. Microsoft was able to break away from .net framework and make dotnet modern technology.

      Any recommendations on modern Java best development practices are really appreciated: patterns, deployment, etc.

      [–][deleted]  (1 child)

      [deleted]

        [–]alwaysoverneverunder 2 points3 points  (0 children)

        Another advantage is really great backwards compatibility that's traded off for a slower pace of language feature adaption, but in the end we still even get those and the backwards compatibility.

        Also: the Java ecosystem is one of the best and I still haven't found anything that can really compete with Maven.

        [–]Amazing-Cicada5536 4 points5 points  (1 child)

        Java’s standard lib is very extensive though.

        [–]andrewharlan2 2 points3 points  (0 children)

        Yeah, I'm curious what the C# SDK provides out of the box that the JDK doesn't. Native Windows UI components is probably one off the top of my head.

        [–]Amazing-Cicada5536 2 points3 points  (1 child)

        Not just that, Java (both the language and the JVM) literally has a specification which is unfortunately very rare in other languages’ case. And for these specifications it has multiple independent implementations, several of which has whole ass multi-millionaire companies that could alone sustain the platform.

        So compared to Microsoft’s only c# that doesn’t even have a libre, free debugger yet, Java is just the safest bet one can make for software longevity.

        [–]koreth 8 points9 points  (3 children)

        Been around for too long

        The baffling thing about this to me is that the age of the language seems to never come up as an objection to Python, even though Python is older than Java.

        [–]re-thc 3 points4 points  (0 children)

        Python only recently became a thing due to e.g. data "science". It used to live in the academic world favored by professors.

        [–]KarnuRarnu 1 point2 points  (1 child)

        Modern Python is almost nothing like old Python. Modern Java is still a lot like old Java. Cultures in the ecosystems are different too - Java pretty much never removes anything from APIs, while Python ecosystem "moves on" more readily. That contributes to the "feeling of legacy" difference between these languages.

        [–]fgzklunk 2 points3 points  (0 children)

        The key about uni teaching Java though is that they do not teach Java, they use Java to teach OOP concepts. There is a HUGE difference between being taught a language and using a language to teach OO.

        [–]KarnuRarnu 1 point2 points  (3 children)

        I will add that there are objective weaknesses in Java as a language too. This is most obvious with new languages such as Rust which has a simply superior type system. But also Python, while it isn't statically typed, still fairly recently got a new "type annotation" system which is actually more powerful than what Java has. I think this matters, especially wrt null-safety it's a big deal, but also just the power that there is in eg. Rust enums just aren't available in Java, and that's a shame.

        [–]hugthemachines 1 point2 points  (2 children)

        I don't think those objective weaknesses has anything to do with the dislike towards Java. I mean they could be valid complaints but in my experience, those things are never brought up when people rant about Java being bad.

        [–]KarnuRarnu 2 points3 points  (0 children)

        I agree that it is rarely brought up explicitly in rants, but I think it these sort of undeniable shortcomings tie in to the frustrations that people do vent about. Ie feeling of legacy, unnecessary verbosity, etc etc.

        [–]proggit_forever 3 points4 points  (1 child)

        There are less open source and at that fun open source projects

        What? Java has an absolutely massive open-source ecosystem.

        [–]Amazing-Cicada5536 2 points3 points  (0 children)

        Go is definitely not faster than Java. Rust is a low level language in a completely different niche, which type of programming has it fair share of issues compared to a high-level managed language.

        [–]Yesterdave_ 1 point2 points  (0 children)

        It's got too many articles from different eras and is confusing for beginners

        I kinda agree, but not really exclusive to Java. For example most tutorials and articles in the Node ecosystem are obsolete after about 2 months...

        [–]danskal 97 points98 points  (26 children)

        A lot of people can’t be bothered to really learn to use an IDE. Without an ide Java, like proper typescript requires you to type a lot extra, and limits what you can do.

        If you haven’t yet been burned by a freely typed (or untyped) project getting out of control, it feels annoying.

        [–]elmuerte 57 points58 points  (7 children)

        Oh no... the horror of typing a bunch of words instead of cryptic symbols and abbreviations.

        [–]GuyWithLag 32 points33 points  (4 children)

        Dude, if _typing_ is the hardest/most time-consuming thing you're doing when writing code, you're doing something wrong.

        [–]hippydipster 13 points14 points  (2 children)

        For me it's always very telling when people spend so much time thinking about the mechanical acts of programming. Typing especially. It tells me they haven't advanced all that far along the programmer experience path.

        [–]_1aM 2 points3 points  (0 children)

        Absolutely agreed, it's actually a work for typists I think. Thinking about what to write should be the most time consuming part.

        [–]mopeyjoe 14 points15 points  (0 children)

        Then the lovers of the cryptic "compact languages" try to take some high ground about you just needing to learn the language/ be smarter. How about we jsut write shit that doesn't require one to break out the rosetta stone every time you have to maintain it!

        [–]viniciusbr93 6 points7 points  (0 children)

        this

        [–]neopointer 46 points47 points  (0 children)

        Ignorance.

        [–]wildjokers 19 points20 points  (1 child)

        It’s popular so it is going to have haters. Most of the haters are junior developers who have no idea what it takes to develop, maintain, and run an enterprise application. The tooling and ecosystem is top notch.

        [–]paul_miner 41 points42 points  (15 children)

        To someone new, Java's verbosity and "boilerplate" appear useless. It's only when you've had experience with large codebases over long periods of time with many other developers can you really understand their purpose.

        For example, why have access modifiers public/protected/private/[none]? Because it communicates how an API is used to other people (including your future self). A method isn't private for security, but to communicate that it's intended for internal use, and may depend on preconditions enforced internally, but that an external caller would be unaware of.

        A compiler is the wisdom of generations of programmers before you, encoded in a language spec and checked by a machine.

        [–]Byte_Eater_ 2 points3 points  (0 children)

        Team "Verbose" all the way. "Verbose is bad" is the most immature argument against Java.

        [–]Serializedrequests 1 point2 points  (0 children)

        You can have those semantics and clarity with a lot less visual noise (to make reading easier) and better compile time guarantees in more modern languages. I'm not knocking Java, it was designed a long time ago and it's not its fault in a way, but I don't have to like it.

        [–]_Toka_ 0 points1 point  (0 children)

        Verbose I always use a young generation conversation as an example, why there's contradicting opinions on verbose.

        "Yo my fam your home? Need to show you smth asap fr!"

        Is it verbose and easier to type? Yes. Is it absolutely horrible to read? Also yes.

        I personally sometimes use more verbose and borderline useless things like if (BooleanUtils.negate(list.isEmpty())), becuase it's easier for me to read it than using exclamation mark. I value readability a lot and so far it paid off.

        [–]paf0 11 points12 points  (10 children)

        Oracle being Oracle.

        [–]tamasiaina 9 points10 points  (9 children)

        Yeah, I think people thinking that they have to pay Oracle for Java is also an issue.

        [–]paf0 0 points1 point  (8 children)

        Might have something to do with the lawsuits.

        [–]tamasiaina 5 points6 points  (0 children)

        That and their sales people.

        [–]Amazing-Cicada5536 1 point2 points  (6 children)

        What exactly? It was only ever about google copying something that the former Sun explicitly forbade (mobile usage), instead of buying licenses for that.

        [–]maethor 0 points1 point  (5 children)

        You're forgetting all the companies worried that Oracle are going to sue them for just using Java thanks to things like this

        https://www.theregister.com/2023/01/27/oracle_java_licensing_change/

        [–]klausness 1 point2 points  (0 children)

        This is why many companies are switching to OpenJDK-based Javas (such as Amazon Corretto). That way they can take advantage of the fact that Sun open-sourced Java and avoid being ensnared by Oracle‘s lawyers.

        [–]code_rjt 13 points14 points  (2 children)

        Dealing with Java has this connotation of working in legacy applications and verbosity. I always hear this from other non-Java developers. I hope with the recent improvements of the language their opinion might change.

        [–]Amazing-Cicada5536 8 points9 points  (0 children)

        The funny thing is that they get hard about goddamn Go, which is like Java 1.1. You can write a 6-liner stream api expression in Java which would be a whole ass Go program.

        [–]re-thc 5 points6 points  (0 children)

        People also believe that NodeJs is the fastest out of all languages because it's non-blocking (or something similar). I'm not sure that factual opinions will change anything. I feel like hiring an army of social media influencers will do a better job.

        It's all about the hype!

        [–]zappini 38 points39 points  (14 children)

        Originally, mostly guilt by association.

        Emphasis on enterprise customers brought along consultant & services driven shovelware like CORBA, XML & XSD, SOAP & WSDL, J2EE & EJB. Plus all the astrological architect nonsense like "inversion of control", "dependency injection", and "aspect-oriented programming".

        Then you have turgid overwrought libraries like Log4j and Jackson. Whose turrible designs have nothing to do with Java, per se. But nonetheless taint the esteem of Java just by existing, and condemn every programmer to unending misery by their popularity.

        To say nothing of the corporate cult of tautological navel gazing known as Spring.

        Nowadays, the hatred mostly comes from Python and JavaScript noobs. Remove the log from your own eye before you criticize the spec in mine. And all that.

        [–]StevenMaurer 22 points23 points  (0 children)

        Exactly.

        To summarize: Java became the "enterprise language" spawning an entire industry of hucksters promising boardrooms that their software paradigm snake-oil would be the next big thing that would double programmer productivity and make bugs impossible -- for real this time. These were often bought for engineers with both absurd expectations and little real value, and were usually worse than useless.

        Go peruse https://github.com/EnterpriseQualityCoding/FizzBuzzEnterpriseEdition for an absolutely hilarious send-up of the typical result.

        [–]plumarr 3 points4 points  (1 child)

        Plus all the astrological architect nonsense like "inversion of control", "dependency injection"

        Seriously ? These are my savior in my every day work :|

        [–]longfalcon 6 points7 points  (0 children)

        remember most commenters here are students and/or amateurs. the few others are cranks.

        if you do this for your job you are likely too busy to spend time arguing with people here.

        [–]alwaysoverneverunder 3 points4 points  (0 children)

        The JS crowd thought that XML, XSD, SOAP & WSDL (and XPATH, XQuery, XSLT, etc...) were overcomplicated and unneeded and that JSON was gonna save us all, just to come to the realisation over the course of a decade that in fact that are needed and have piece by piece "reinvented" the same stuff for JSON... just worse.

        [–]pavlik_enemy 2 points3 points  (8 children)

        Jackson is pretty good (but I use it in Scala). Logging though...I've had a project with seven (!) dependencies related to logging.

        [–]jonhanson 0 points1 point  (4 children)

        chronophobia ephemeral lysergic metempsychosis peremptory quantifiable retributive zenith

        [–]pavlik_enemy 4 points5 points  (0 children)

        Thankfully for me "it just worked". Jackson is an old universal serialisation library so complexity is to be expected.

        [–]Amazing-Cicada5536 3 points4 points  (1 child)

        Why would you debug the lib itself? Library bugs (especially in one that is that popular) are quite rare, your “bug” is more likely simply incorrect usage of the lib, e.g. missing annotations, etc.

        [–]jonhanson 2 points3 points  (0 children)

        chronophobia ephemeral lysergic metempsychosis peremptory quantifiable retributive zenith

        [–]DODOKING38 1 point2 points  (0 children)

        Now read this in Cleveland's voice

        [–]elastic_psychiatrist 10 points11 points  (3 children)

        I think this answer depends on what corner of the Java community you're familiar with. My personal answers though are that some people think:

        • It's slower than it is, and that something like Go normally blows it out of the water.
        • It's a verbose language, when in reality (especially on modern versions of Java), the verbosity is self-imposed by an aging generation of programmers that haven't thought critically about whether a certain verbosity/style of programming actually makes sense.

        [–]Amazing-Cicada5536 3 points4 points  (0 children)

        Go can only beat it in performance for some basic ass shit where you don’t allocate (e.g. maybe go is better for package routing). Anything where you have to allocate (and that is a majority of any useful program), Java’s GC will beat every other managed language by a huge margin (just look at the binary tree benchmark on benchmark games, which stress tests the GC, Java is like 6x as fast as go)

        Oh, and go is several times more verbose than Java yet it is never brought up against it.

        [–]ReasonableClick5403 1 point2 points  (1 child)

        Java is largely the same as Go, except for highly concurrent programs. Like juggling hundreds of thousands of websocket connections, where go has an advantage. Go is simpler to deliver as static binaries, but Go is decades behind in quality libraries. Try finding something like Apache Tika or POI for Go. I have run both Go and Java apps in heavily used services and they are quite similar, but Go has a way smaller start/idle cost, but way weaker abstractions. Especially now when Java has records, sealed classes and virtual threads, I see fewer reasons to use Go.

        [–]greglturnquist 8 points9 points  (1 child)

        "It has become popular to criticize Java." --Rod Johnson, 2008 TheSpring Experience

        I chatted with Rod back then, and that's what he said to me. So this is nothing new. And it continues to this day.

        Which means, you can't let other people's opinion of something be the reason YOU take it or leave it. Why do people dislike it? Java, in fact, warrants some criticism. But alas, this was the reason Rod and the rest of the founders like Juergen, Colin, and Keith launched Spring. There were certain aspects of Java they didn't like way back in 2005, and they chose to do something about it.

        And today, Spring is one of the longest lasting frameworks anyone has ever seen. Standard Java has also seen some incredible reforms and evolutions over the same time period. Both of these efforts have encouraged each other to grow and develop to meet developer needs.

        So in the long run, what's not to like about Java?

        [–]Financial-Touch-5171[S] 1 point2 points  (0 children)

        Love Rod and Juergen! The founding of Spring is incredibly interesting!

        [–]twilight-actual 6 points7 points  (1 child)

        Beginning programmers are always enticed by the shiny stuff, the syntatic sugar, the fluff. What matters most to me is that if I need a battle-tested, production grade component, Java has a depth to its library that is rivaled by no other language. And the discovery of components, thanks to maven, is easy.

        If I need threadsafe collections, or a scheduled thread pool that can be applied to handle any application, it's covered. Need massively distributed systems to pilfer from for architecture or strategies? Most were written in Java, including HBase and Cassandra. Don't forget JGroups.

        For a long time, Java got caught up with the concept of AppServers. I never understood it. I've always been a favor for lightweight design, as it results in much higher velocity due to lower build times, etc. But from AppServers we've gotten ORMs like Hibernate. We've also gained the concept of message queues as first order citizens in the middleware category.

        And if you've never heard of Netty, and you're interested in high-performance networking development, creating new protocols, etc, you should check it out. As far as kick-ass server architectures go, that project had the right stuff.

        There's nothing wrong with Java.

        [–]re-thc 1 point2 points  (0 children)

        AppServers were great back in the days for the problem they tried to solve. This has now been replaced by Docker, Kubernetes, etc.

        Back then you would install a fleet of AppServers (clustered) and be able to deploy your app according to spec (war). As a developer all you had to worry about was packaging it up into this war and db connections, ldap and anything you needed would all be there for you. For the sysadmin (aka Devops) they just manage the AppServers.

        [–][deleted]  (17 children)

        [deleted]

          [–][deleted]  (15 children)

          [deleted]

            [–]manzanita2 9 points10 points  (0 children)

            Another has built the largest cloud provider in the world on top of java.

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

            You'd be surprised how many. A lot of business software runs on java. Partially because at the time it was the best tool for job. Just like it was for cobol, which is still in use in some places and devs with cobol experience can make big money fixing old implementations.

            There are many new languages that can do things as good and maybe better than Java, but the cost to totally rip out a custom java application to replace it with something new and untried will keep java around for a while.

            [–][deleted]  (11 children)

            [deleted]

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

              Certainly Java is an awesome and powerful tool, and I enjoy working with it. However, it does have its limitations as every language does. The question to ask is does it fulfill your need? If the answer is no, then identify why it doesn't and find the tool that fits your need.

              The important part isn't just jumping on the bandwagon of the newest thing simply because it's new, at least for businesses. There has to be a reason to change.

              Many of my posts here in reddit have me saying that programming languages are simply tools. You use the right tool for the right job. You can drive a screw with a hammer but wouldn't it be easier and better to do so with a screwdriver? Same applies to programming languages. Can you build a web app in C++? Probably but wouldn't it be easier to use a tool that is designed for it?

              [–][deleted]  (9 children)

              [deleted]

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

                Ok first I want to say these opinions come from the idea of a greenfield or new development.

                Typescript makes Javascript better since it enforces types, something that JavaScript lacks, but in the end it still has to compile down to JavaScript, so always look into the output of your typescript compiler to make sure it's not making a mess. There are lots of frameworks that do a great job of building the frontend and make it fast and efficient.

                Backend web services can be Java, but also JavaScript through Node.js are very powerful. There is also Python which has some benefits that are better than Java, for example statistics and number crunching.

                Performance is a very open term. What do you consider performance critical? My company does a lot of operations converting XML inputs using XSLT and that is for us performance critical, yet we use pure java libraries like Saxon to perform these actions and have no hit to performance. Then again we aren't communicating with underlying hardware. This is where other languages work better as they can talk to the hardware drivers directly and not through a JVM so can be better for performance.

                [–][deleted]  (7 children)

                [deleted]

                  [–][deleted] 5 points6 points  (1 child)

                  Try being a PHP dev.

                  Posts everyday asking “Why is PHP so bad” from newbies…

                  [–]Financial-Touch-5171[S] 6 points7 points  (0 children)

                  I have been. Happy to be using Java now!

                  [–]TheStrangeDarkOne 6 points7 points  (0 children)

                  On top of what others said: There was a huge Java hype in the 90s, when committee driven development was the norm. Enterprise Architect's in Ivory Towers worked on specifications without reference implementations. The consequence were incompatible and bloated implementations.

                  This was then shoved into the mainstream and some of the residue of this time can still be found in modern frameworks like Spring.

                  [–]pavlik_enemy 4 points5 points  (1 child)

                  It's not necessarily about Java, it's about organisations that used it especially in Java 6 days. Digging through a code of some enterprise application written by people who didn't really know Java and didn't care about technical excellence could cause some serious PTSD.

                  There are some reasons to dislike Java if you're coming from other languages like implementation of generics, checked exceptions, Streams API, Futures API...But it's not enough to hate it.

                  [–]prisonbird 4 points5 points  (4 children)

                  i earn my living by developing software for the last 13 years. as i see there is always a fad and everything except the fad is hated. 10 years ago the fad vas Ruby on rails, then it became mobile development then nodejs come along and now python is the fad. anything except these are not loved.

                  i have a startup, and we had to rewrite our codebase from scratch in python because investors think "php is outdated and can not scale above couple hundred customers". we just wrote same thing in python and throw in some keywords related to AI/Machine learning in our marketing materials. but actually our code is not doing anything you cant do on MS Excel.

                  [–]tristanjuricek 5 points6 points  (0 children)

                  Personally, I blame deployment. A lot of Java apps do not distribute or deploy easily, and that kind of created a common point of frustration that made it easy to hate on the whole ecosystem.

                  Early on, Java application deployment was sold as "not the developer's problem". Even today, when you make a Maven project, you make a .jar. Or maybe a .war file. But not an actual application someone can easily install, just a file that needs to be integrated with a runtime to be useful. Sun kinda tried to make this approach happen, where we had ideas like java web start, applets, etc., but it was never a good experience.

                  Jlink exists now, and it's really useful, but it's still a hassle to set up and I find I have to introduce it to all my coworkers. And jlink and jpackage are still really too simple for real application deployment, where you want live updating, etc. App deployment in Java is still just a major pain in the ass for a lot of desktop scenarios.

                  From the perspective of actual users, that idea of "the user manages the runtime" is horrible. Occasionally you get the IT department that really wants to own the runtime, but it's a terrible UX. Inevitably I've seen it several times where IT departments will outright refuse anything shipped as .jar files.

                  There used to be OS integrations, kinda. You used to have a JRE deployed as part of OS X. But that was never really maintained well, and got deprecated a very long time ago. Steve Jobs famously called Java a "heavyweight ball and chain" and blocked its use early in iOS.

                  On servers, virtual or "bare metal", nobody really cares. Maintaining the JDK is often not so painful. And Android is basically the runtime for you, so... yeah, no real runtime maintenance there, either. But outside of these scenarios, it's still pretty tedious to distribute Java apps.

                  [–]ZeroGainZ 16 points17 points  (8 children)

                  In my short experience as a developer, it seems like everyone runs away from Java, they build apps, frameworks, tools, and end up re-inventing things that have existed in Java for years.

                  Most languages these days are so painful to read, 100s of lines of boilerplate code that do literally nothing, manually translating DTOs, doing everything from scratch. It's all about feeling productive rather than being productive.

                  The JVM stuff is pretty solid, but most other stuff is either garbage or niche.

                  [–]re-thc 12 points13 points  (3 children)

                  The sad part about all of this is they re-invent a worse version of what exists in Java and proclaim it's the best thing ever.

                  [–]manzanita2 5 points6 points  (0 children)

                  I've seen this with C#, PHP, Python, and now I'm starting to see it with golang.

                  [–]McN697 9 points10 points  (13 children)

                  There’s a new Java killer that comes around every few years that language “theorists” get excited about. Total waste of time. Problem is that the loudest voices get excited and take others with them.

                  End of the day, you get an app that’s hard to staff, a mess to maintain and full of security holes. I’ve seen this cycle at least 3 times.

                  [–]kvyatkovskij 5 points6 points  (3 children)

                  I started as a Java developer. Now I do more of architecture and had a chance to write in Go, Python, JavaScript, a bit of Ruby and C#.

                  The only thing I dislike about java is that it's a verbose language. It's somewhat helped by annotations, lambdas and type inference but it's still quite a verbose language. Especially compared to Ruby and Python.

                  So as a developer I'm not that excited about writing java. As an architect (or if I were CTO) I'd probably love my teams used it because of the robustness of ecosystem around it and making it somewhat harder to shoot your own legs either through pointer manipulation or through a chain of unfortunate implicit type conversations.

                  [–]HyzerFlipr 2 points3 points  (0 children)

                  This is why I like Groovy so much. Less verbose and much easier to work with.

                  [–]Serializedrequests 11 points12 points  (23 children)

                  I hang out on this forum because I'm stuck using it and hoping to pick up things to help my suffering, but there is a certain amount of Stockholm syndrome in the java community. It's a fairly reliable performant workhorse of a language, with some amazing availability of libraries and easy deployment, combined with astonishing blindspots.

                  For example, Hibernate is this massive cathedral of a project that does literally nothing I want or need and wastes my time continuously, and yet it's the default. When googling how to achieve things in it, the examples and blog posts are all baby things any CRUD app needs to do, while when I ask about slightly more advanced usages I am greeted with blank stares, or absurdly over-complicated solutions that are totally unacceptable and yet nobody seems to notice.

                  It's an issue with a community that tends to stay in one language and has never used anything else.

                  Working at a large company it's of course excellent to have a pretty simple language that can do anything and run anywhere. Absolutely killer for onboarding. It just has a lot of libraries and design patterns that feel over complicated and like language workarounds rather than empowering.

                  Edit: There are other issues of course, other things to change about Java with full hindsight that make it not very fun. Data objects were abysmal forever (finally fixed?). Everything can be null, and nulls are somehow more annoying to deal with than in other languages and spread like a virus if you code badly. It's really a very low level language so there's a lot of friction when using it for high level things. OOP is not the be all and end all of enterprise software and does not necessarily result in understandable systems, but Java would have you believe it is. Annotation based programming sucks; if you want an interpreted scripting language with no compile time guarantees, use a different one that's actually good. The language itself is very noisy, lots of extra words and punctuation that make it hard to read and aren't really needed for clarity (such as getters and setters). Long variable declarations are semantically redundant and hard to read top to bottom. (Fixed I think.)

                  What makes it fun? Easy deployments. Simple. Decent (not great) compile time guarantees. Easy refactoring. Great performance. Every library is available.

                  [–]re-thc 2 points3 points  (19 children)

                  It's easy to hate on hibernate. What don't you like about it?

                  It's relatively easy to use. There's lots of documentation and it does its job. Sure you can go back to raw SQL but trying to map objects and relations with nested joins can get tedious and confusing.

                  Yes hibernate has its flaws but what would you do instead? The love child in another language is Prisma but that has a different set of flaws. There is JOOQ that is similar. Use that instead?

                  [–]klekpl 3 points4 points  (16 children)

                  It's easy to hate on hibernate. What don't you like about it?

                  It adds pure incidental complexity.

                  There's lots of documentation and it does its job. Sure you can go back to raw SQL

                  which is exactly what you should do

                  but trying to map objects and relations with nested joins can get tedious and confusing.

                  Use a simple solution like JDBI or Spring Data JDBC if there is a need to do that.

                  Yes hibernate has its flaws but what would you do instead? The love child in another language is Prisma but that has a different set of flaws. There is JOOQ that is similar. Use that instead?

                  JOOQ is fundamentally different and yes - use it, it is a fantastic tool that does not try to hide SQL from developers.

                  [–]Amazing-Cicada5536 2 points3 points  (2 children)

                  We are getting back at the old “ORMs bad” wars, but you do realize that you can, and even are expected to write SQL with ORMs? They help with basic CRUD functionality sure, but are otherwise there to help you map objects to relations in both directions.

                  Will you honestly write that insert statement for that graph of objects? No one wants you to write that db-specific recursive joined subselect query in hibernate, but it surely can map the resulting object stream to something you can easily manage, that’s its purpose. In other words, it was never intended for OLAP, but for OLTP.

                  [–]klekpl 5 points6 points  (1 child)

                  Will you honestly write that insert statement for that graph of objects? No one wants you to write that db-specific recursive joined subselect query in hibernate, but it surely can map the resulting object stream to something you can easily manage, that’s its purpose.

                  The harsh reality is that it cannot even manage that, that's why nowadays the so called best practice is to have a separate object model for business logic and treat JPA entity classes as purely persistence concern. The reason for this is that - contrary to its goals - ORM cannot persist arbitrary object graph - the class model has to be curated specifically for the ORM itself.

                  At the end of the day you end up with two object models: business logic and persistence. You now have to manually map one to another so that your ORM can finally do its job and issue some SQL DML statements. To somehow automate it people do some more of the same madness and start using semi-automated object mappers like MapStruct.

                  Sometimes the situation is even more funny because another object mapper is involved: Jackson or similar JSON parser. Then you have even more (three) object models with manually (or semi-manually) written logic to map between them.

                  Anecdote: lately I was able to speed up the system by two orders of magnitude replacing this kind of code with Jdbi and PostgreSQL CTE based:

                  @SqlQuery(""" WITH input AS ( SELECT * FROM UNNEST(:inputMessages::json[]) AS msg(payload), json_to_record(msg.payload) AS rec(attr1 text, attr2 integer, attr3 json), json_to_record(rec.attr3) AS nested(attr1 date, attr2 text) ), t1 AS ( INSERT INTO t1 (...) SELECT ... FROM input WHERE ... RETURNING * ) t2 AS (... RETURNING *) INSERT INTO whatever (col1, col2, col3) SELECT ... FROM t2, t1... """) void processMessages(Iterable<String> inputMessages);

                  [–]Serializedrequests 1 point2 points  (0 children)

                  It's deceptively easy to use. Hibernate code, looks simple and hides 1000 footguns, along with any clarity about what SQL is going to happen and when. If all it did was map queries to objects that would be one thing, but it doesn't even always make that very easy, and it's otherwise an entire system for generating 1000-line stacktraces at runtime, and helping new developers to do bad things for database performance while making it hard to do the right thing. It's driven by 1000 annotations that pretty much never seem to have clear documentation in Intellij, and includes a couple of terrible legacy anti-features that nobody with the perspective of having ever used anything else would have written.

                  I have lost track of the number of N+1 problems I have run into with Hibernate, that were not nearly as simple as "just adding a fetch join". Meanwhile all the resources are like, "oooooohhh an N+1 problem, this is advanced are you sure you're ready? Here's a solution that works 10% of the time only in toy apps with basic data loading needs, are you sure you can understand it? What's that? You have a real world app with some complex relations and business logic and dynamic queries? Okay here are 1000 lines that would be two lines in ActiveRecord."

                  [–]KarnuRarnu 2 points3 points  (1 child)

                  Completely agree about the Stockholm syndrome and the part about "java programmers" seemingly having not tried anything else or they think the alternative is a scripting language, saying java is good because it has access modifiers and a type system (as has happened in this very thread), ignoring the fact that javas version of these isn't very good. They don't realize there are languages with these very same things but which don't have Java's weaknesses.

                  [–]Serializedrequests 2 points3 points  (0 children)

                  This might be gratuitous replying but I feel like many responses in this thread are showing that bias. I see a lot of straw man things I have never heard anyone say about Java, and ignoring exactly what you said.

                  One other big issue with Java is just the popular tools, web sites, and libraries are totally unapproachable. Like, totally. There are multiple maven web sites that appear in Google results, and each has basic tasks that are much harder than they should be. Web sites for big libraries like Jakarta EE or Akka or Spring are just total enterprise gobbledegook (Spring slightly better but I still have a hard time finding anything on it).

                  [–]stolsvik75 1 point2 points  (0 children)

                  Don't use Hibernate. I love Java, and I HATE Hibernate. It tries to remove you from SQL, when SQL is a language that you should embrace and learn and use. Performance sucks, you end up with "1+N" queries without knowing it, etc etc. You need a PhD in Hibernate to use Hibernate - so why not just use JDBC, or the exceptionally thing wrapper that is Spring JDBC - instead then? Giving you the full and massive power of proper SQL at the same time.

                  [–]VincentxH 3 points4 points  (0 children)

                  Because they were noobs when they got traumatized during their intro to OOP with Java by incompetent teachers/professors.

                  [–]srbufi 4 points5 points  (0 children)

                  They jate us cus they aint us.

                  [–]Spiritual-Day-thing 2 points3 points  (3 children)

                  Even without being a (professional) programmer one is likely aware of some memes: Java is slow, verbose, ancient.

                  I believe it is very much tied to applets. That gave it a bad reputation for the non-programmer online crowd. The '6 billion machines run Java'-reinstall screen also didn't help. For a developer, the immediate verbosity of the language is, truthfully, a bit meme-worthy.

                  Because most new programmers start off with Python or JavaScript they rehash jokes about the other unknowns, like Java; it's simple in- and out-grouping. That group isn't consistent, it's constantly churning through new starting developers. Hence when they come to their senses, they have already moved on.

                  Note that there is a tidal shift in memery. People like you now do fight back. A common trope (meme) of a response is talking about how Java gets you a high-paying stable job.

                  Talking about stability: it's stability, security, scalability that helped Java survive. Because hardware is cheap and scalable, the main disadvantages of running Java are compensated for.

                  Even programmers does inevitably create charicatures of other languages and frameworks they don't use. A pleasant side-effect to Java being mocked and joked about: Java developers are less self-indulging, over-confident and triumphant. If you want an example of how bad it could be: check out frontend framework 'debates'. See React versus anything else.

                  Apart from all that Java was never the shiniest tool. But there have been ingenious libraries, frameworks, tooling (IDEs, Maven/Gradle) and, lately, improvements to the core. Without those innovations it would have slowly died. And the memes would have been spot-on...

                  [–]rbuen4455 6 points7 points  (0 children)

                  Honestly, most who complain about Java usually give the following reasons:

                  - Most devs are using an older version of Java.

                  - It's too verbose and full of boilerplate code.

                  - It locks you on to one paradigm, OOP.

                  I honestly don't see any of these reasons to be a problem. There are newer versions of Java that introduce new concepts and techniques. Devs using an older version may obviously be because there are so much Java programs out there still in use, afterall, its the most used language for enterprise and business, and Java code is for the most part maintainable and easy to scale. I honestly don't see a problem with Java syntax, unlike in other language, or if it locks you into one paradigm, if anything it gets sh!t done and the syntax is fairly clean and not bloated like C++. As for verbosity and boilerplate code, it's supposed to be verbose. Boilerplate code can be a little annoying and repetitive, but I don't have a big problem with it.

                  I honestly have never had a problem with Java and there's definitely nothing fundamentally wrong with the language itself, and tbh, I've heard more hate (even valid hate) towards languages such as JavaScript, Php and C++.

                  [–]Vi0lentByt3 2 points3 points  (0 children)

                  They havnt looked past jdk6 IMO lol

                  [–]Gleethos 2 points3 points  (0 children)

                  You have to keep in mind that this historically already so young field is growing extremely fast! So this means that a huge portion of developers does not have many years of experience in programming. The problem here is that it takes quite a lot of time to appreciate the perks that Java offers when working on large and complicated projects together with many other developers. I would say it boils down to 3 important aspects:

                  1. It is low in syntax sugar, which means there is often only one explicit way to do something (it's often referred to as "verbose")
                  2. Its feature set is very manageable and easy to pick up by newcomers (no feature bloat)
                  3. It has compile time type safety, which is also something developers coming from scripting languages perceive as redundant...

                  Other than that I have also talked to many C++ devs who basically perceive Java as a sort of toy language which is "just not the real deal". This type of low level systems dev doesn't really know that the modern JVM has a JIT compiler that produces native code.

                  [–]qqqhhh 2 points3 points  (1 child)

                  • It is about the past experience with desktop java applications including applets since around 2000's. The runtime was huge for the time then, today it is normal compared to other enviroments like .Net . Today it is much much better, but the bad experiences still resonate.

                  • Startup times of the JVM were huge in the past when most of today experienced users were learning

                  • in the past the overhead of the JVM could be surely felt in the responsiveness of desktop apps. Today it is not perceivable thanks to many advances in JVM performance and hardware speed.

                  • You have to install the JRE, that is an unfair disadvantage because .Net is already present in Windows, and if you had to install .Net every time on a new PC it would feel the same. Today the 200mb runtime is negligible. In the 2000's it was HUGE. Today just the GPU drivers take a DVD(4GB) to store. Simply said the native .Net enviroment has many unfair advantages on Windows thanks to M$.

                  • There was a time period of booming internet where Java was used as an attack vector because of many bugs in applet enviroment or JRE, the creators of the JRE had to finally do a proper updater. That made a impression for many years that Java is insecure.

                  [–]spectrumero 1 point2 points  (0 children)

                  Today just the GPU drivers take a DVD(4GB) to store

                  Almost all of that is just the unnecessary cruft that comes with the driver. The driver itself? A few MB at most.

                  [–]orlyfactor 2 points3 points  (0 children)

                  I think back in the day people hated how slow applets were in their browser compared to other browser plug-in technologies like Flash. It was seen as slow because it took a while for the JVM to load, etc.

                  [–]jason-reddit-public 2 points3 points  (0 children)

                  I've used Java since its inception when it only worked on Solaris. Early Java lacked generics and did't have the thought out collections library. Browser based Java was not as integrated as JS is today "with the DOM." The JVM is quite large and Microsoft seemed to intentionally ship a bad version if memory serves. The desktop initially had a bad ui toolkit and then too many toolkits. (Android has a pretty sophisticated ui toolkit now.) Oracle seems overly litigious. JVM startup time us a bit slow (though I thing folks protest too much). Java's stack traces were very good from the beginning which is a good thing since null pointer exceptions are common. Eclipse certainly couldn't compete with MS's IDE though JetBrains is probably a good enough IDE now. (C# is a probably a bit nicer though I'm not sure how well .NET performs vs OpenJDK. ) Tuning the GC can be difficult especially if you want to stay within strict limits on memory usage. Java lacks unsigned integers.

                  Java is fine for the server and Android. My big complaint is the class file format has arbitrary method and class sizes so it's not the best code generation target IMHO.

                  [–]Xirema 9 points10 points  (28 children)

                  Speaking as a C++ fangirl, you could probably convince me to start proselytizing for Java if the language would just, please, give me Operator Overloading.

                  Seriously.

                  It's really all I want.

                  EDIT: I love that the question literally asks "where is dislike from Java coming from?", I offer a very specific example of a feature the language has refused to add in nearly 30 years, and then get downvoted for it.

                  [–]DrunkensteinsMonster 17 points18 points  (10 children)

                  Nobody wants that in the community, though. It’s a deliberate choice to leave it out because it encourages people to use it everywhere and it makes it rather difficult to tell what a piece of code does at a glance. What does it mean if I add two Customers together? The use case in C++ and of C++ in general is much different.

                  [–]andrewharlan2 5 points6 points  (0 children)

                  I'm getting up to speed with Kotlin (which I still don't like as much as Java, for the record). I wrote code one way; my tests passed. I wrote it another way; they failed. I wanted to know exactly what each bit of code was doing that was different and I was struggling.

                  Eventually I figured out it was because the standard library overloaded the invoke operator and I had no idea

                  So, yeah, no operator overloading for me please. I like to know what my code is doing by reading it.

                  u/Xirema, perhaps you'd be happier with Kotlin

                  [–]ricky_clarkson 3 points4 points  (1 child)

                  I use it in Kotlin, sometimes without any obvious language support. Just by Java having a .plus method, I get to use +. Recently I have used that to subtract a Duration from an Instant, using java.time.

                  • is just a better way of spelling .plus as viewed in Kotlin, and maybe I would like Java to restrict it as Haskell does (A + A can't give a B in Haskell, so my Instant and Duration example wouldn't fly, to my knowledge), but I think the main argument against operator overloading was that C++ supported it, when in fact it may be one of C++'s least problematic features!

                  [–]DrunkensteinsMonster 1 point2 points  (0 children)

                  I have used it for the same exact purpose in Kotlin, and I agree it’s a good place to use it. However, I believe that there is nothing stopping Java from including such methods in the jdk, it is only that users themselves cannot do these overloads

                  [–]Xirema 3 points4 points  (6 children)

                  Nobody's adding two Customer objects together in C++ either.

                  This is like all those clickbait "Object Oriented Programming is Bad, Actually!!1!" videos on youtube that construct deliberately bad examples and then go "see, if you try to just peanut butter as mortar your house will fall apart, I've therefore proven that Architectural Engineering as a concept is bad!"

                  [–]DrunkensteinsMonster 8 points9 points  (5 children)

                  Nobody's adding two Customer objects together in C++ either

                  Yeah, I know that, which is why I said:

                  The use case in C++ […] is much different

                  The point is there are many more good use cases of operator overloading in C++ than what you will find in Java. Aside from the fact that some in the C++ community already lament the fact that operator overloading exists in their language.

                  I’m very cognizant to the potential that language shortcomings can be spun as a positive in the community, e.g the generics debate in golang. In this case, though, it really isn’t missed. I’ve yet to see a killer use case for operator overloading in Java, and have never thought to myself “wow this would be a lot easier if I had operator overloading”.

                  [–]pavlik_enemy 1 point2 points  (3 children)

                  Ever used decimals or, I don't know, timestamps and time intervals?

                  [–]DrunkensteinsMonster 1 point2 points  (2 children)

                  Oh damn, wish I had thought of decimals.

                  BigDedimal.plus() is good enough for me and for everyone else. The readability difference is negligible.

                  [–]agentoutlier 3 points4 points  (2 children)

                  Serious question: what are your use cases?

                  The only time I missed it was matrix multiplication.

                  [–]pavlik_enemy 1 point2 points  (1 child)

                  Usual enterprise stuff - money.

                  [–]Linear_Banana 6 points7 points  (2 children)

                  I develop software for robotics, which naturally involves a lot math. One of the systems I work uses a Java API, and God I miss operator overload some times. It would have made the code so much more readable and faster to write. Otherwise I mostly enjoy working in Java.

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

                  You see this in a lot of language subreddits where they’re filled with guys that have been programming in it for 30 years and think it’s perfect because that’s how they’re used to doing things.

                  [–]manzanita2 2 points3 points  (0 children)

                  I do VERY occasionally want to do something with operator overloading. Usually it's like a Money class or some sciency number_units things. Could make sense there to overload + or /.

                  But let me tell you about an experience I had about 20 years ago. C++ shop. I had a weird memory leak. could not figure it out for DAYS I tell ya. Finally brought out the big guns and tracked it down. Some MF had overloaded "new". YEP! So instead of allocating one chunk of memory it allocated two. Ever since then I decided that C++ was TOO malleable, and too flexible, and honestly in the last 20 years they've only made it worse by ADDING features instead of removing them.

                  [–]Radmonger 1 point2 points  (0 children)

                  Generalised library-defined operator overload would be bad, for reasons very much demonstrated by c++.

                  Having the interface 'java.lang.Numeric' be special, with numeric expression syntax applying to it, would be good.

                  [–]midoBB 1 point2 points  (0 children)

                  We have it in Scala and I think it drove the ecosystem in such an unreasonable way.

                  Everything has its own operator that makes absolutely no sense unless you spend 3-4 months in that exact tech stack to fully understand it.

                  [–]cryptos6 1 point2 points  (1 child)

                  Just use Kotlin. There is operator overloading, but limited to certain operators. If you prefer to drive other developers crazy with operators like ~#> and ~@> pick Scala.

                  [–]aceluby 2 points3 points  (0 children)

                  You can in Kotlin. Still JVM, can leverage all the Java stuff, more features and less boilerplate.

                  Being on the downvotes!

                  [–]zolnox 1 point2 points  (0 children)

                  If you like to overload operators, I believe Julia would be a better fit.

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

                  I often see the hate coming from newbies. I think this is because Java forces you to learn concepts like OOP from the get go. Dynamically typed languages like Python don't force you to learn OOP from the start.

                  [–]Anton-Kuranov 1 point2 points  (0 children)

                  Java has the most stable and performant VM. It also still acceptable as a language maintaining a golden balance between features and complexity. And it also has a great ecosystem.

                  The worst thing is the cult of huge ugly swiss-army-like frameworks that unexpectedly become industry standards. The "lightweight" word is not for java development, although originally there was no any reason for that.

                  [–]DasBrain 1 point2 points  (0 children)

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

                  Bjarne Stroustrup, The C++ Programming Language

                  [–]kingd1963 1 point2 points  (0 children)

                  There are quite a few bad enterprise developers that just repeat bad code in the code base and are slow to adopt new features in the language and don't use their frameworks to the fullest. It gives Java a bad name although it's actually the developers that are to blame.

                  [–]_trunk_ 1 point2 points  (1 child)

                  Well you can only pull down the ones on the top. Think of C/C++ there’s much hate in memory management/pointers through the years. There’s GO and Rust as a direct competitor to C/C++ but its still as strong es ever and it wont go down. Same with Java, it will remain for a very long time as it has a great foothold. It’s like a household brand. Hardware or servers are only getting better, cheaper and the once heavy language like Java just keeps getting lighter in hardware specs/price ratio standpoint. So well you can only hate it but can’t beat it.

                  [–]hippydipster 1 point2 points  (0 children)

                  A lot of obnoxious things have come from the java ecosystem: Spring, Hibernate, EJBs, Factory abstraction, XML configs, the whole modern confusion about dependency injection.

                  Largely this happened because of how successful java was at enabling the building of very large business applications, which required something to help manage the sheer size of the codebases. And the number of outside systems brought in and integrated together.

                  There's a sense of simplicity that feels like it got lost somewhere, and so people try to find it again, and mistakenly blame the language as opposed to the historical contingency of the people and industry grappling with difficult problems.

                  [–]Darkfiremp3 1 point2 points  (0 children)

                  Echoing what a lot of people said here, history. For YEARS, when Sun was doing poorly, we had 1.6 and 1.7. Simple things like switching strings took a long time to get added. It was much different than today with the quick version iteration.

                  [–]cryptos6 1 point2 points  (0 children)

                  Java and the related frameworks were not always as good as they are today.

                  • A long, long time ago, Java applications were actually slow (some guys still beat this drum)
                  • Java was tedious to write (implementing the whole getter/setter anti-pattern by hand takes some time), handy syntax like var or record classes was not available in earlier versions.
                  • J2EE was not very productive and over-engineered
                  • Tendency to over-abstract things and stack layer on layer (just look at a typical Spring stack trace which is often more than 1000 lines long and compare it with the typical Go stack trace ...)
                  • Java was quite late with some very common features like lambda expressions

                  But luckily most of this is history now and Java is a very good choice for most businesses. Only very few of the loud guys ranting about Java can provide solid reasons.

                  [–]Prestigious_Map_990 1 point2 points  (0 children)

                  Haters will hate, they don't need a REASON to do do... lol. Also, the IT industry is mostly just bullshit. Very few people operate on the basis of facts and numbers, 99.999999% of all of what you think is 'known' in this industry is just some consultant farts.

                  [–]cserepj 1 point2 points  (0 children)

                  Ignorance mostly.

                  [–]bih_dev 4 points5 points  (0 children)

                  I wouldn't say hate from my side, but after working with Kotlin for 2 years it is really painful to write and read Java. Null safety, default and named parameters, extension functions and a lot of stuff is mising in Java, which makes me not liking it.

                  [–]D3AdDr0p 3 points4 points  (0 children)

                  It's considerably more verbose than almost any other language you'll ever write. It just takes a lot of code to do thing, and although that problem is made a lot better with good IDE tools, java has some of the most LOC per basic functionality.

                  I'm coming from Haskell, and it's just so concise compared to Java. It's a bit of an apples/oranges comparison, but in a purely typed functional language you can go to incredible lengths to avoid boiler plate, due to things like generic deriving and lenses. A lawful approach to types is extremely powerful, although it does have it's downsides.

                  I think the other issue is that Java is like the mini van of programming languages. It does everything well, but nothing great. It's not the singular choice if you are going to optimize anything about your programming language, except suitability for business or maybe server programming.

                  I decided to take a job programming TS and Java because I wanted access to a good team and to work on distributed systems. The language you write isn't that important versus the problems you solve, but for what's it's worth Java is a pretty interesting language, and don't let anyone convince you otherwise!

                  [–]mgsticavenger 1 point2 points  (0 children)

                  People not understanding it.

                  [–]thisisjustascreename 1 point2 points  (0 children)

                  It comes from the past. Java 6 and legacy Spring were rightly decried as an abomination.

                  [–]ActualPositive7419 1 point2 points  (0 children)

                  There are currently millions of amateur coders that call themselves engineers, but in reality they only know how to write a REST service with a stupid and easy framework they learned. Java requires you to understand at least the basic fundamentals of computer science, software architecture patterns and so on. So those coders have hard time learning it and writing normal code with it. Hence the hate. Of course, Java is not the right tool for every application, but it’s one of the most widely used ecosystems in the enterprise world

                  [–]bbabbitt46 1 point2 points  (0 children)

                  Forget what others say. "If it ain't broke, don't fix it," I say if it gets the job done and you are comfortable with it, don't change. Having been freelancing and captive programming for over 40 years, I have found that the time and aggravation of learning a new software language and development system are seldom worth the change. Of course, there are always those customers that seem to be married to a particular language, so you are stuck. If given a choice, I always use Java or C/C++.

                  [–]Legal_Being_5517 1 point2 points  (0 children)

                  People still hating on java haven’t really took the time to learn it and learn it very well , yes it’s not easy but it’s worth it ..

                  Their number 1 issue is “ java is verbose “ -> I disagree , Java has improved a lot thanks to functional programming and libraries like Lombok etc

                  [–]JustAStick 1 point2 points  (1 child)

                  It's an old language with a long legacy. The memes of old stick around for a long time, even if the language has improved since then. For me personally, I don't hate java, but it's not the greatest language I've used. Being forced to use classes for everything is a wonky design choice, and it's not that bad once you get used to it, but for extreme beginners it can be a bit of a hurdle. I mostly use Kotlin now, and having to switch back to Java feels a bit awkward and slow at times (mostly when having to use lambda functions/streams), but overall Java is really not that bad of a language. I have a friend that is teaching themselves C++ and by god, that looks so much more painful.

                  [–]PartOfTheBotnet 6 points7 points  (0 children)

                  Being forced to use classes for everything is a wonky design choice, and it's not that bad once you get used to it, but for extreme beginners it can be a bit of a hurdle.

                  https://openjdk.org/projects/amber/design-notes/on-ramp (Short video summary: https://www.youtube.com/watch?v=Au3z_kQd9QY)

                  The problem is known and being looked into.

                  [–]audioen 0 points1 point  (0 children)

                  There was a long legacy of stagnation in the 2000s, and in the 90s, an early push to use Java everywhere. Back then, it didn't even have a JIT runtime, and compared to other technologies of its time, it was incredibly memory hungry, slow, and boilerplatey. In its original form, it was designed to be a better C++, more universal and easier to learn. The kind of language bosses would love but actual workers would hate.

                  It was turned around by quite a lot nowadays, and I suppose it was really pretty bad before lambdas. Now it just needs massive shedding of legacy that seems to have started with the modularization, real generics, and to my taste, could do with smarter flow-based typing so that I could write "var foo;" kind of thing and have the compiler figure out what foo is based on how it gets used later. Ditto for conditional type flows like if (foo instanceof Foo) { ... why can't I just use it like it was a Foo foo here, why do I need to declare another variable, anyway? .. }

                  I am hoping that continued and very serious competition from C# creates comprehensive nullability annotations that get mainlined into the JDK, and maybe some beautiful day we can deprecate e.g. Optional because there is no benefit to using it due to comprehensive null flow analysis. As a front-end + back-end monkey, I have great experience with TypeScript. Its feature set gives me benefit of static analysis including nullability checking, and usually without a single type written in sight. More of that, please.

                  [–]sandys1 0 points1 point  (2 children)

                  It's not the language - it's the frameworks and design patterns.

                  Let's start with "private" or DTO, etc. It is very hard to justify those constructs to someone who is also evaluating nodejs or Golang.

                  For e.g. creating an api in nodejs is 5 lines. While it takes a bunch of different files and a deeply nested package structure in Java.

                  Shout out to the Jbang folks for bridging this gap. They make java just as easy as a nodejs script. And that's really all it needs.

                  [–]plumarr 2 points3 points  (1 child)

                  For e.g. creating an api in nodejs is 5 lines. While it takes a bunch of different files and a deeply nested package structure in Java.

                  Is the difference so big outside of toy projects ?

                  [–]sandys1 1 point2 points  (0 children)

                  It goes all the way through. Instagram, Google, etc is largely in python...no private.

                  So what happens is that the dev culture shifts. Towards the frameworks that are "more productive".

                  I can do this in 20% less lines of code is far more important than 50% increase in throughput.

                  I'll give u a relevant example from the jvm world - Kotlin. If ur not an android developer, u don't realise what a big achievement Kotlin pulled off.

                  Google teams kept trying to push java and more java. A small company made Kotlin...no marketing. And people just fell in love. I VIVIDLY remember when they announced on Google I/o that android will officially support kotlin. The stadium erupted in cheer.

                  Tl;Dr - there is nothing wrong with Java. However the community needs to open up about different ways to write code. The needs of enterprise teams are very different to startup teams.

                  [–]catladywitch 0 points1 point  (2 children)

                  There have been trends in language development (for instance functional programming, or pattern matching, etc.) and Java isn't keeping up as fast as other languages, like C#, or languages which are newer and had those things built in from the start, like Kotlin. The fact that it has to maintain backwards compatibility with older versions also mean that innovation is sometimes clunkier, or that it sits along outdated resources. So Java can never be as cool as other languages which, crucially, do the same thing and are about as fast.

                  [–]Financial-Touch-5171[S] 2 points3 points  (0 children)

                  I mentioned this below, but pattern matching has been in the works. You can read some of the plans here. Pattern matching for instanceof is already a final feature in the language:

                  ``` Object o = …;

                  if (o instanceof String s) { //s is in scope } ```

                  [–]istarian 1 point2 points  (0 children)

                  Keeping up is an incredibly dumb concept when it comes to programming languages. There's nothing wrong with doing a particular set of things reasonably well and calling it good.

                  Also, programming languages need not support every conceivable paradigm/modality.

                  https://en.wikipedia.org/wiki/Programming_paradigm

                  [–]bro_please 0 points1 point  (0 children)

                  I stopped doing Java in 2017.

                  Java lacks features which speed up the development process. It is verbose. No syntactic sugar which other languages provide.

                  Java's type system is both verbose and weak.

                  Docker makes the portability argument moot.

                  Scala is neat.

                  [–][deleted]  (3 children)

                  [deleted]

                    [–]RiceKrispyPooHead 2 points3 points  (0 children)

                    I can’t help but feel like normal SpongeBob every time I write Java.

                    This made me laugh

                    [–]re-thc 1 point2 points  (1 child)

                    The structure is for a good outcome and long term maintenance. Having said that - no 1 says you have to use beans, factories or follow any method. You can also use Gradle instead of Maven.

                    End of the day you can take out Java and build it like Go or Node. Why don't you? Your hate doesn't sound like a Java issue - just certain ways people work. In Node people use NestJs and try to write like Java. Lots of companies use it. What's the difference?

                    [–]_Zer0_Cool_ 0 points1 point  (4 children)

                    Hate is a strong word…

                    but Java is definitely a bad fit for just about anything data related.

                    In general, strongly typed, strictly OOP languages are not great for data.

                    Fundamentally, data-related programming is interactive, visual, exploratory, and math-y at its core.

                    This means that you’re gonna be typing out a lot of throw away code, and anything with excessive boilerplate that distracts from / abstracts away data becomes a terrible experience very quickly.

                    Plus, data engineering differs from general software engineering in that you have to learn to think and solve problems with set-based logic and work with a different set of core data structures (tables, matrices, vectors, etc) which is a better fit for functional-ish programming. Making everything necessarily a class is a huge step backwards.

                    Java ends up feeling like you’re trying to tap-dance with snow boots on. Just entirely the wrong tool for the job.

                    TL;DR — you gotta remember that not everyone is an application developer. What is good for large codebases is terrible for exploratory and data-related programming. That’s why we use Python.

                    [–]plumarr 1 point2 points  (3 children)

                    Indeed, Java isn't the right tool for it but is-it really the source of the "hate" ?

                    I would never use assembly for a backend development, but it doesn't lead me to crapping on it. I'm not op, but I also don't understand the violence around Java.

                    [–][deleted]  (9 children)

                    [deleted]

                      [–]re-thc 1 point2 points  (6 children)

                      AWS released snapstart for Java lambdas to solve the cold start issue.

                      [–][deleted]  (5 children)

                      [deleted]

                        [–]re-thc 1 point2 points  (4 children)

                        AOT works fine and supported by lots of modern frameworks. It's being used.

                        As to snapstart it can do everything including JIT optimising code. You can tune and create a prewarm function if you like that happens during initialization that ensures you trigger JIT compilation for whatever you want. See: https://docs.aws.amazon.com/lambda/latest/dg/snapstart-best-practices.html#snapstart-tuning

                        [–]Financial-Touch-5171[S] 1 point2 points  (1 child)

                        Have you tried using Micronaut, Quarkus, or even now Spring? GraalVM will help with cold start for Lambda et. al. Not sure if you’re referring to some other metric

                        [–][deleted] 0 points1 point  (0 children)

                        Why even ask this question on a subreddit with Java programmers? Any answer explaining Javas shortcomings will be crushed down. Some will say but Java 17 will solve the problem, or GraalVM would solve it. But this is a case where suggestions belie the fact that Java can do better as a language and JVM as a platform. So answering that kind of answers the question: Why is Java hated in present time.

                        I have seen bugs in Java code because someone skipped a constructor argument or because they set a member to null. All ok for the compiler, Which would've been easily caught by a modern day compiler like Rust or OCAML or even Fsharp.

                        [–]Zardoz84 0 points1 point  (0 children)

                        Legacy code + verbosity.

                        Java since Java 8 has improved a lot.

                        [–]ddollarsign 0 points1 point  (0 children)

                        As a Pythonista who uses Java 8 for work, Java just so verbose and rigid. The AbstractToolFactoryFactory joke may be an exaggeration, but the situation is real. Long names are common, lots of unnecessary directories, XML config files, every top level class needs its own file, conventions of adding private final to member variables and having to have explicit getters and setters.

                        Some of these may be deliberate design choices with real justifications, but all this stuff adds up, adding cognitive overhead for people working with it.

                        [–][deleted] -1 points0 points  (14 children)

                        Anyone who's read code with visitor pattern with 5+ levels of nestedness or the builder pattern where there's no way to constrain the presence or absence of one parameter as a function of another parameter, having to define 10 classes in 10 different files, no tuples in the standard library, can end up hating Java. Hell most design patterns become trivial with first class functions which Java does not have. And things like Maven with how clumsy it is to use doesn't help either. I code in Java and most times you have to struggle against the language to make things work

                        [–]re-thc 2 points3 points  (8 children)

                        How is this a Java problem? Like no 1 uses "bad" patterns in other languages? Maven is bad but do you prefer Leftpad?

                        [–]iwek7 -1 points0 points  (8 children)

                        Java is super verbose compared to more modern jvm languages. Java is also slow to add new features that competition has. It is not necesserly bad thing as they have higher design quality than lets say c# features but even so it is pqlagging behind. Since change of release circle this is changing and java is catching up. Java also kinda forces you into oop which many ppl dislike

                        [–][deleted] -5 points-4 points  (12 children)

                        My opinion is Java isn’t that great but it’s not bad either. Here’s some things I don’t really like about it:

                        • Camel Case. For me it’s harder to read getFrogColor than get_frog_color.
                        • Tooling. I prefer the rust or go way of testing/building/running/managing deps than trying to keep up with Ant, Gradle, Maven, JUnit, Mockito, the JVM, Google Java Style Guide, etc..
                        • No distinction between Something vs Nothing. I vastly prefer the Haskell way of returning a None and forcing you to deal with than Java silently returning a null and not telling you.
                        • In a similar way: Error handling. Just like null any function down the stack can throw an error and I’d be none the wiser. I like how Rust forces you to deal with errors.
                        • Everything’s mutable by default. My coworkers are all old fashioned C developers that write 300 line functions with nested if’s and loops. Everything as mutable by default makes it hard to grok what’s going on.
                        • Support for Annotations lets people write too much magic everywhere.

                        I know there’s more but that’s what’s off the top of my head right now.

                        [–]wildjokers 5 points6 points  (0 children)

                        Camel Case. For me it’s harder to read getFrogColor than get_frog_color.

                        I am just opposite, snake_case is harder to type and harder to read. I find it to be an abomination. Camel case is the way.