r/java • u/Reflection-Jealous • Sep 10 '21
Why people don't love Java?
I came across this post in r/cscareerquestions it seems majority of the people don't love to work with Java.
Is there any specific reason for that?
Edit: Thank you guys for your responses, I can't reply to all of the comments because I'm a beginner myself and I don't know what to reply for all your comments.
242
u/Marriaud Sep 10 '21
I had been working on poor quality java codebases and I started to get bored of Java. Then I worked on a poor quality JavaScript codebase and I started to love Java (not Script).
30
u/trafalmadorianistic Sep 11 '21
Static typing and having namespaces by design. Don't know what you've got til it's gone.
542
u/thomascgalvin Sep 10 '21
The people posting to that sub are typically young, and probably have more experience with Javascript than anything else.
Compared to JS, Java can feel heavy and constricting. Lots of boilerplate, a type system that's strictly enforced by the compiler, and so on.
It isn't until you have some real-world experience, with code spread out across dozens or hundreds of files, that you realize the "limitations" of Java are actually meant to prevent you from blowing your own foot off.
137
u/Gk2k08 Sep 10 '21
Agreed here. I worked on a Django project(when it was the cool thing) and thought that python is so better than typed languages(It has its uses but not in a complex system with 1000s of classes). Once this project scaled up from me being the only developer on it to have multiple people and having more than 10k lines of code it became a complex piece to maintain. If there is no unit test case for all the scenarios the only place you would see an error is in runtime. Imagine doing int + string in your log statement and that brining down prod app and having to rush a fix for that.
35
u/analogsquid Sep 10 '21
Imagine doing int + string
When I started programming, I was always blowing up my Python projects with stuff like this, and I never knew why.
Discovering and switching to Java was a revelation.
24
→ More replies (2)4
u/introvertedidiot123 Sep 11 '21
I've been working with Django at my job for just over a year. It was this, among other things, that made me become an advocate of type checked and statically typed languages like Java and Go for any kind of major project. The mental effort of dynamically typed languages is best left to scripting and small sized projects
8
u/Oo__II__oO Sep 10 '21
Thank you for this. I'm tilting at windmills trying to get my management team and adjunct R&D team to agree on a language for production tools, and they both are pushing for Python or JS, while I am telling them a strict typed language with rules makes more sense. They don't feel the pain when the system goes down because of some untested edge case, but are more interested in deploying quickly and not spending a lot of time on code management (just what is easy for them).
→ More replies (1)11
u/thomascgalvin Sep 10 '21
For such an easy "out of the box" language, Python really does have some huge footguns.
10
u/Gk2k08 Sep 10 '21
To be fair Python is easy to start and has its uses at places. Once it is used for a huge project with multiple developers that is when it's limitations come out.
3
u/umlcat Sep 10 '21
Worked with a slightly typed Basic when I was a kid, not a teenager, and when I learned typed P.L.s, it was difficult & odd at start, later found out "this is the way", I mean, it was a better option.
2
u/AndyTheSane Sep 10 '21
Yes.. in CBM64 basic, type was inferred when you assigned a variable for the first time. Even declaring variables seemed strange at first.
1
u/Rakn Sep 10 '21
I haven't worked on larger python projects yet (unlike with Java or Go), but I feel like modern Python with it's type hints is somewhat better. The pain begins when there are libraries using things like **kwargs. Or these generated libraries like boto3 (what a shitshow).
Unfortunately there is still too much untyped python code out there, that I'm always reluctant to use it on a larger scale.
2
u/scyth3s Sep 10 '21
Type hinting is still trash imo. It helps, but it will never be as useful as real, strong types.
→ More replies (2)1
u/scyth3s Sep 10 '21
I couldn't stand Python when I was working in it, it fostered a seething hatred of untyped languages. Trying to make external libraries work, utilize classes, etc, just felt like complete anarchy and very error prone.
I'll take the order and expandability that Java provides over saving a few lines of code in python any day.
75
u/maomao-chan Sep 10 '21
Lol the duality of JS programmers, praise Typescript but hate statically typed language like Java.
45
Sep 10 '21
The especially amusing thing is people claiming that Java is slow, while their favourite language is Python. That's how you can tell they're just repeating memes they've heard, and ones that haven't even been true since the 00s (modern Java is very fast)
→ More replies (8)17
u/thomascgalvin Sep 10 '21
Modern Java can be faster than C in some instances. The current generation of VMs are insane.
3
u/ihbarddx Sep 10 '21
Java faster than C? I've heard this. Any specific examples? Any specific examples where all C variables are static?
→ More replies (2)15
u/Rakn Sep 10 '21 edited Sep 10 '21
People always compare fast Java code with highly optimized C code. You cannot beat highly optimized C code. But the thing is that most people do not do such optimizations. I have been working in a project where we had dedicated employees tasked with optimizations. But a normal developer is unlikely to look at the produced assembler code and refactor the C code on that basis. If you do normal feature development, especially in the web service area, Java beats many alternatives in terms of speed. Obviously not at the first iteration. But at some point the JIT kicks in ...
At least that's my take on it.
49
u/CraftyAdventurer Sep 10 '21
The issue has more to do with verbosity and encapsulating everything in classes and having lots of configurations than with types themselves.
I was on both sides, Java and JS/TS (and even some Kotlin and C#). In Js world, many things are easy to do from the top of your head, so I feel way more productive just writing the code. In Java, I always have to reference a guide, tutorial, documentation or an existing projects to do a lot of stuff. I feel like I spend too much time on that.
The best example I can think of is JWT. When using express, all I had to do was create a middleware which validates received jwt, it's very easy because middleware is just a function with request and response objects. So you basically write
function jwtMiddleware(req: RequstType, res: ResponseType, next: NextFunction) {const jwt = req.getHeader('Authorization')const isJwtValid = validateJwt(jwt)if (isJwtValid) next();else res.send(401)
}And that's it. That's something I can write in under a minute from the top of my head. There's nothing specific I have to remember about that, it's a function with three parameters. And it uses Typescript, which doesn't increase verbosity almost at all.
Also, inserting middleware in the express code is extremely easy, you just call those functions before or after the API routes (or inside a route if you want something specific), depending on when you want to run them. That's intuitive to me. I can just open a main file in any project and immediately see the order of middleware.
In Spring, I wanted to do the same thing. But I had to configure Spring Security first, which means I have to learn basics of that (well not really, could just copy it, but I like to know and understand what I write). After that, I had to create a class which extends OncePerRequestFilter which acts as a middleware, but it's already much more verbose than a simple (req, res) function, because I can't just create a function, I need to extend a class called OncePerRequestFilter and override it's method, and put it in a specific place in Spring Security configuration, and so on and so forth.None of these things take under a minute, and I still don't know how to do that from the top of my head, I always need to refer back to the specific project or tutorial and copy most of the stuff. I know how it works, I just don't know how to write it myself because there are more files to create, more methods and classes whose names I have to remember and configurations I have to do.
Also, from what I saw, when you write those filters, you can @ Order annotation. Meaning that there could be many of those classes spread out all over the codebase, and if I want to know in which order they run, I have to manually search for them.
I still prefer Java over JavaScript, mostly for it's more stable and mature ecosystem, but some things to me are just not intuitive. Yes, those are mostly related to Spring and not Java itself, but most of the jobs use Spring anyway so there's that.
Sorry for the long comment :)
Edit: code formatting30
Sep 10 '21
Woah woah woah woah...woah...woah. Woah. Hold on there cowboy. Don't blame Java for Spring. Spring is not Java's fault.
→ More replies (12)24
u/CraftyAdventurer Sep 10 '21
I'm not blaming Java, but the fact is that Spring is used everywhere. People who hate on Java probably don't hate so much on the language, they just had to work with Spring and didn't like it. I mean, even I was comparing frameworks here (Spring vs Express) and not languages, but that's just how the industry works, you work with a framework, not pure language. And that framework can create a certain image about a language it uses.
→ More replies (3)9
u/passive_talker Sep 10 '21
There are many ways of validating an auth token in Java, but with spring boot you create a servlet filter with a @Bean method et voilà. You get access to the request and response in the same way as express.
Spring security does many other things for you, but the trade off is complexity.
4
u/nutrecht Sep 10 '21
And that's it.
You can easily do the same in Spring with a filter or interceptor. Pretty much the same amount of code. You don't have to use Spring security. But what you do there is incredibly basic; you don't even pass on the stuff 'inside' the JWT to be used inside the service.
This is what always bothers me about these types of comparisons; at least make a fair comparison of how you'd do the same thing in Spring.
→ More replies (5)2
u/Comprehensive_Idea98 Sep 11 '21
I really, really miss something like express for java. I have seen some efforts, but they all fizzled out.
→ More replies (1)2
u/minimingus Sep 12 '21
Exactly this. I’m mainly a Java dev, and in my current job i also work on a huge enterprise application (payment hub) where the verbosity of Java works really well - I can’t even imagine using js for such a beast, but when i was using js for a small personal web project everything feels more intuitive and “just works” without any hassle.
I guess it’s mostly because Java is multipurpose, and js was “built from and for the web”
6
1
→ More replies (3)1
u/Reverse_Grodd Jan 03 '22
Not really a duality. Front end developers are well aware of the limitations of raw JavaScript, the very reason TypeScript was embraced. Because TypeScript is a superset of JS, you can use the discipline of TypeScript 98% of the time, but also type an object as "any" when it does make sense to use the dynamic capabilities of JS, and know you're not paying a performance hit for that in the run environment.
4
u/umlcat Sep 10 '21
Right. Later Typescript, CoffeScript & other.
I started a typed version of JS, before those. Never got time to fully implemented.
3
u/thomascgalvin Sep 10 '21
I used Flow for a hot second, which was the precursor to Typescript. Typescript is so much better.
3
13
u/Danelius90 Sep 10 '21
I think another issue can be a lot of "java devs" can't code in java for shit. If you write procedural code, loads of static methods, no consideration for OOP and just use Object, String and arrays everywhere rather than define your own types then you're going to have a bad time. We work with a third party at my company and the way I describe a lot of their code is tutorial level. You can tell because it looks like code taken from a blog post in 2006
8
u/vips7L Sep 10 '21
I personally think this is all devs in every language. There is shit code every where. I’ve seen procedural crappy code from go/python/js/rust devs. You name it someone’s written crap in it.
Java is just super well adopted and everyone thinks they know it so you get a ton of people who don’t know what they’re doing writing it.
2
u/Danelius90 Sep 10 '21
Yeah I agree. As you say java is widely adopted so a lot of devs have probably seen bad stuff in java. Java does have a rep of being clunky and verbose, and I do think this is particularly true of it if you code in the way I described. For some apps javascript can be quite efficient when written, but poor JS code suffers from really difficult bugs that some of java's features help mitigate if done properly. But it's swings and roundabouts, every language will have strong and weak points and depend a lot on the dev writing it!
5
u/wildjokers Sep 10 '21
a lot of "java devs" can't code in java for shit.
I blame Spring for this. I am shocked by how many "java devs" can't do anything unless Spring does it for them. If there isn't some magic Spring annotation that does it for them they are totally lost.
→ More replies (1)8
u/_Jeph_ Sep 10 '21
There's nothing wrong with static methods. The problem is when there is global state involved.
→ More replies (2)5
u/experts_never_lie Sep 10 '21
I expected you to mention bad practices, but you went straight to atrocious ones. What you're talking about is more than bad enough to get your git access revoked at a former employer. Yes, they actually did that when one developer's work took more of others' time to fix it than just writing it.
5
u/Danelius90 Sep 10 '21
In all honesty I think a lot of them haven't used git either. I kid you not, one of them messaged me the other week saying they couldn't check out a branch after cloning a repo. The problem was they didn't cd into the directory (which the error message made clear, saying "this is not a git repo"). And I really wish I could tell you it was one of the juniors...
Problem is I think the company has a long contract with them and previously the company had outsourced all development to these guys before upping their in-house capability. One of the first things I worked on was deleting all their work for the past 4 years and rewriting it from scratch.
one developer's work took more of others' time to fix it than just writing it.
We're finding the same too now. A lot of code reviews are just "start again and rewrite this entirely". Hopefully things will eventually get better
→ More replies (1)1
u/CloudsOfMagellan Sep 11 '21
I actually disagree, Pretty much the only languages that my uni expressly teachers in the compsci degree are C++ and Java. But they only teach the basics, loops, classes, control flow, primitive data types, and not the STL stuff that can simplify so much boilerplate code. Then students start using JavaScript irl and are amazed at lambdas, flexible arrays, stuff like that. Add that Java is long to type (uni didn't mention var or <> or even generics at all really) Java code becomes very long and very tedious compared to other languages that students self learn fully. They only moved from allowing Java8 to Java11 this year for assignments.
→ More replies (63)1
u/Reverse_Grodd Jan 03 '22
JavaScript certainly will let you blow your own foot off, though you can avoid that by using TypeScript with patterns and frameworks. But Java is also hampered by a somewhat ungainly toolset, and a developer community filled with people who've never broadened their skillsets beyond the Java they were taught in CompSci.
When you look at the exciting tooling and platforms of other systems (like NodeJS and VSCode), Java and Eclipse don't loom all that exciting.
123
u/psyclik Sep 10 '21
From my experience, most people ranting about Java are stuck with a 2005 view of Java.
11
4
u/FrozenST3 Sep 10 '21
True. I graduated in 2003 and in my first interview (Java post) I said that I don't love it and would prefer to work in C++ (LOL) because all I knew was core Java from my studies. Eventually being introduced to some frameworks I grew to love it
6
u/schnurlostelefon Sep 10 '21
This precisely. Stuck at some old Java version at work, or only learned a little bit of Java many years ago in school.
4
u/fix_dis Sep 10 '21
To be fair, some of us had great dreams of using newer Java, but we were stuck with a 2005 code base, and architects that were (with reason) terrified to move forward. That’s pretty common in enterprise level software. If it’s not broken, and it’s making us millions of dollars, what do we care if you want to use Records.
1
u/dpash Sep 10 '21
Not to mention their views being based on J2EE 4.
1
u/trafalmadorianistic Sep 11 '21
Any job ad with the term J2EE is instant red flag for me. 2010 last time I worked on a code base using all the enterprise Java garbage, running on WebSphere, and I could just feel all my contemporary knowledge getting lost from disuse.
1
1
0
Sep 10 '21
[deleted]
25
Sep 10 '21
It's especially bemusing to see teens repeating the "Java = slow" meme and then going off to use... Python. Python's a fine language, but it's pretty damn slow lol
→ More replies (1)11
Sep 10 '21
It’s even funnier is python is horribly slow, it’s only fast when you specifically use native libraries like numpy in the right way, which is just c/c++/FORTRAN code. Java is actually really fast and has an awesome jit, but people mix up booting a 10 million loc app with it being a slow language, or compares hello world speeds. I’ve run 10 million users a day, 100s of million requests a day Java applications on medium size ec2 instances with no problems.
18
u/PartOfTheBotnet Sep 10 '21
Gotta love it when you hear "Java is slow because it is interpreted, like Python"
36
u/viniciusbr93 Sep 10 '21
I don't hate it, it pays my bills.
12
u/speedingpeanut Sep 10 '21
This ^ also having worked on legacy perl systems written by maniacs java is a breath of fresh air
5
1
151
119
u/redikarus99 Sep 10 '21
Because they never worked on big, or even medium sized projects as part of a developer team.
21
68
u/BS_in_BS Sep 10 '21
It's pretty easy to overcomplicate things with 75 different design patterns. it can be somewhat verbose at times with naming and generic types. From a linguistics perspective there are many features that other languages have like more robust type systems with things like dependant typing, more powerful null typing/handling, better exception handling, tail recursion optimizations amount others.
I think what people miss is that there's a lot of magic in the runtime, like simultaneously allowing jit compilation, hot swapping and concurrent garbage collection, which are difficult to get right on their own, but brutal to do altogether.
Also I think one thing most people don't take into account is refactoring, which I find is easier compared to other mainstream languages like python or golang
In the word of Stroustrup, there are 2 kinds of languages, those that people hate and those that no one uses
5
Sep 10 '21
Also I think one thing most people don't take into account is refactoring, which I find is easier compared to other mainstream languages like python or golang
This is the main reason I stick to statically typed languages. IDEs can do intelligent refactorings and analysis with almost no errors, while even renaming a variable can be unreliable in a dynamically typed language
→ More replies (3)4
u/FrozenST3 Sep 10 '21
You aren't compelled to implement all the known design patterns out there. Design patterns are also relating more to your paradigm (OO in this case) than the language itself.
In my 15 years of enterprise development, what happens under the hood in the JVM has very rarely been a concern. Why would JIT and hot swapping be a top of mind consideration for your runtime?
35
u/lunkdjedi Sep 10 '21
I hated Java before embracing it's conventions.
At first I was ignorant of the rules, then I didn't believe they were needed, then I fought against them and lost. Not all of this was pure Java, a lot of it was maven and how to structure things in their opinionated way.
After 20 years, the rules, the opinions, the structure, are things to depend on and catalyze success.
16
u/FrozenST3 Sep 10 '21
100%. Anyone familiar with Maven projects can become effective pretty quickly because they don't need to spend time figuring out how to build and where to place specific items, etc.
8
u/coderguyagb Sep 10 '21
This! This is the problem with Grade.
→ More replies (4)5
u/imadownvote Sep 10 '21
What's the problem with gradle? The exact same thing can be said about Gradle.
Anyone familiar with Gradle projects can become effective pretty quickly because they don't need to spend time figuring out how to build and where to place specific items, etc.
→ More replies (2)7
u/snoob2015 Sep 10 '21
The problem with Gradle is they keep changing their implement every month, they don't even care about backward compatibility
→ More replies (1)
17
u/ScheduleSuperb Sep 10 '21
It’s just trendy to hate on Java... My explore page on Instagram is full of crappy “Programming memes/tips”. Here they all promote Python as the best 😎 and Java just sucks 😡
I think a lot of people are just ignorant and not very experienced developers. For me programming is to find the right tool/language to do the right job for me depending on what project I am doing.
32
u/pron98 Sep 10 '21 edited Sep 10 '21
There are some good answers here, but I just want to point out that Java is one of the most popular programming languages in the world, and is quite possibly the #1 language among professional developers. The only two other languages with the same size and influence are JavaScript and Python. JS gets even more hate than Java, and while Python not so much, we must remember that a huge portion of Python users are not professional developers (but data scientists etc.) and that's the only general-purpose programming language they know. Also, Java projects, like C++ projects, tend to be large and long-lived; i.e. people don't write the program all by themselves but have to deal with other people's code (and C++ gets more hate than Java). Languages like Go and Kotlin are used by ~20x fewer people, and for projects that are not anywhere near the same size and longevity (at least not yet).
So factoring the size and the overwhelmingly professional setting, Java gets more or less the amount of hate that you'd expect of any language in that position, regardless of any particular merits or more specific circumstances. No other language of similar community size or uses gets any less.
2
u/golfreak923 Sep 14 '21
Really wish the old guard Java dev community would hop on the Kotlin train: Spring + Kotlin + jOOQ is a truly powerful stack.
→ More replies (1)1
u/TheCountRushmore Sep 10 '21
It has to be satisfying and freighting at the same time to know the project you are working will be used by so many systems once it is released.
It's wild to think of the world wide energy savings that could be accomplished if someone was able to increase the performance of Java as a whole by even a couple percent.
2
1
u/kazi1 Sep 11 '21
I would disagree about Golang - there are a ton of HUGE projects its used for that have been for around for quite awhile (Docker, Kubernetes, Caddy, etc., etc.). Golang is fundamentally a much simpler language and it's way harder to shoot yourself in the foot with it than it is with Java.
None of this changes the fact that Java is still significantly more widely used however (and also like 20x easier to hire for...).
3
u/pron98 Sep 11 '21
Kubernetes is very young (~7 years), and is average in terms of size (~2.5M LOC), and still only a very small percentage of Go developers work on projects as old or as big, while a large portion of Java developers work on projects that are older and bigger.
13
u/rzwitserloot Sep 10 '21
A combination of:
Being commonly taught as first language (unlike, say, C)
Having a bevy of languages that are clearly intended to cover similar bases (Python, Ruby, Javascript on Node, various lisp variants, scala, kotlin, and many many more). Contrast, again, to something like C which didn't have a meaningful competitor for things it was particularly good at (more low-level code) until somewhat recently, in the form of Rust.
A lot of java's downsides turn into upsides when the 'scope of human reckoning' over the codebase expands beyond a year. So, if you have a project that takes 2 months to write with a team of 6 folks, you're about at that point, or if you are writing for an entire year on a project on your own, or even if you write something fairly simple, then leave it for a year, and return to it. In all these cases, having explicit typing is nice. Lacking DSL features is usually nice or at least has significant upsides as well (see for example this tweet which is complaining about an issue that simply doesn't happen in java).
These things aren't obvious until you have the experience of operating in such projects.
You can repeat Kernighan's Law a million times to a newbie to programming (and some people that have programmed for YEARS are still a newbie, in that they don't have the relevant experience to grok it; it doesn't really happen until you've been a part of multiple year+ projects) - and they may even be nodding at your sage advice, but I doubt they really 'get it', and without understanding it, java seems obtuse, needlessly complicated, and lacking 'obvious' nice features such as truthy/falsy, optional semis, optional parens, optional params, optional dots, lack of collection primitives, etc.
Kernighan's Law: "Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it."
30
Sep 10 '21
Well, boring is what pays the bills, and maintains sanity when you have to work with multi-million line codebases. Ignore the hispters who wax eloquent on topics they have never experienced.
2
u/Serializedrequests Sep 11 '21
The problem is that OO design patterns do fuck all to make huge codebases understandable, they just add to the spaghetti and make Spring and intense amounts of mocking a requirement for testing. It's all so much jousting at windmills.
Whereas anyone should agree that a compiler and static types and simple language are good for long term maintainability, I do not agree that Java's brand of OOP is good for these codebases. Also Java's type system is old and offers infuriatingly little safety.
2
Sep 11 '21
Forgive me, but to get more context, I dug a little into your post history, and discovered that you have over a decade of Rails under your belt. This makes your rant all the bit strange because when I worked on a project using Rails (the first and the last time) a while, it was 100% magic. I did not enjoy it one bit (thought I find Ruby itself quite charming and flexible), not to the point of hating it, but pretty close. The point that I'm trying to make is that familiarity, especially familiarity that comes over years of working with some sets of technologies do affect the way we perceive new environments, especially new sets of magic, so maybe that partly explains your current frustration with Spring Boot (for instance). That being said, I do agree that the Spring Framework has tons of magic (and Spring Boot is even more egregious since it is a very opinionated view of how to use Spring). There are alternatives, but unfortunately none popular enough.
Just to be fair, quite a lot of enterprise apps (especially those in-house) don't bother using Spring or such frameworks (or have minimal usage of such, just for providing the scaffolding), and so they have almost no magic. It is in this context that OOP really does shine in terms of maintainability. Java's type system may also not be the greatest in the world, but it's much much superior to working with a dynamic type system, especially when it comes time to refactor.
In many ways, I find Java's type system to be in the Goldilocks zone - not terrible, not overly restrictive (like Scala's). Also, since the performance bits are all offloaded to the JVM, the Java compiler is superfast when it comes to compilation speeds (which something like, say, Rust, suffers from). OOP, when done right, can be an absolute pleasure to work with. The trend may be leaning towards Functional Programming, but it has its own sets of problems.
→ More replies (1)
17
25
14
u/Majestic-Extension94 Sep 10 '21
Motivation for this after 25 years can be difficult to ascertain. Originally back in the 90's it was a case of:
Too slow
Too much memory
Now the arguments seem to be:
too complex
too verbose
Some how the hate has been carried forward and the reasons change.
Personally it's a tool for me. I use python, some go and busy playing around with flutter cause there are times when java is not appropriate compared to another language
12
u/Ok_Light310 Sep 10 '21
I came from C# and here's what I hate
terrible tooling. Maven is awful: documentation, syntax, discoverability, xml programming. Gradle is different, but still awful. Intellij is ok, but not on par with Visual Studio.
verbosity and language design choices. You can solve it with libraries, but if you are serious, you'd never add a runtime dependency for syntax sugar if you are serious about your project. Things like lambda APIs blow my mind - why you need 20 of names (hi, biconsumer or is it bisupplier) and how do you remember them.
builders , providers, factories and static singletons. Yes, it's not about java, but common practice.
no usable async programming - verbose, not friendly and nobody uses it anyway
checked exceptions. e.g. if your lambda throws, you have to use interface 😵💫🔫.
magic. Again, it's a common practice, not language. E.g. Spring DI is magical - e.g. you can't find what's in you IoC, you just have it spread all over the codebase with annotations. Comparing it to clarity of ASP.NET Core DI I'm almost crying.
What's cool:
I can step into and debug any platform or library code without any effort
6
u/ryuzaki49 Sep 10 '21
Sometimes I feel developers are starting to act like CEOs. Join a startup company, build as quickly as you can a new app with shitty foundations, then move to the next company before you can maintain your shitty code.
Programming in Java does not allow devs to code faster at the beginning of a project, but sure helps a lot in a mature project.
16
u/RabidKotlinFanatic Sep 10 '21
I think it boils down to people being unaware of "modern Java." They think the JVM is a slow environment, only used by enterprises and that Java programming is stuck in 90s OOP AbstractFactoryConstructorBeanFacadeStrategy design pattern thinking.
5
u/Hioneqpls Sep 10 '21
I'm getting so spoiled with my lambdas I get frustrated when other languages don't offer something similar.. languages.stream().filter(l -> l.aintGotNoLambdas).forEach(l -> l.name + ": i'm trash lol");
3
u/kag0 Sep 10 '21
You should try scala 😉
Also there's no side effect in your forEach so it's a no-op
2
1
u/fix_dis Sep 10 '21
As I mentioned elsewhere, this type of “enterprise software” proliferates the… well… enterprise. Those of us who have been stuck on older code bases see this everyday. Is that Java’s fault? Absolutely not. But it’s hard not to make that correlation when someone starts going down the GoF rabbithole. If I were going to do a startup today, would I pick Java for backend services? I just might. It’s fast, there are a ton of resources. The hiring pool is huge, newer frameworks make it a joyful experience almost. (Quarkus and Micronaut are my two tops right now)
1
u/Serializedrequests Sep 11 '21
I think the laughable enterprise patterns are showing how poor Java's brand of OOP really is though. They had a problem, so they tried to make more random objects to solve it, and created more spaghetti.
→ More replies (1)
14
u/drew8311 Sep 10 '21
I honestly think its because they don't know any better. Java is best for backend development which seems to be split between Java/C#/everything else. Everyone in each of those camps seems to dislike the others, younger people (majority of /r/cscareerquestions) tend to be on the "everything else" because its new and cool.
5
u/BenoitParis Sep 10 '21
I think that's in part a byproduct of Java's success at managing complexity.
A successful project will accumulate complexity. New business rules will be coded into the project up until it's no longer maintainable. And Java has tools to help in that! access modifiers, design patterns serve to allow complexity to be better crammed in.
A successful Java project is often contains a mountain of essential complexity; in which a simple change requires 5 days of archaeology and 5 lines of code. You won't get greenfield assignments by loving Java.
As a newcomer I believe it is a sound strategy to just hate Java, consciously or unconsciously.
1
5
u/ubiquae Sep 10 '21
because in all shiny new startups the stack is node+ws+mongo or something like that.
Of course, no one knows anything about reliability, scalability, noSQL data modelling, performance....
But, hey, it is cool!
5
u/salgat Sep 11 '21
Java is alright, but after using C# with .net core, hard to look back now. It's everything Java should have been. I will say the JVM is a hell of a marvel of engineering and languages like Kotlin are great alternatives.
1
u/trafalmadorianistic Sep 12 '21
What would be the bigger hurdles to deal with if you are going to C# from Java? Libraries? Ecosystem? Any syntax or conceptual differences you recall? Some companies are very tempting right now but I'm feeling constrained as they are only C#. Might have to make the leap.
3
u/salgat Sep 12 '21
My favorite thing is how easy it is to get going. Literally install Visual Studio Community Edition for free and it has everything you need, including nuget (similar to maven), all the build tools, debugging, all the most popular frameworks including ASP.NET (similar to Spring). Add to that a few things like LINQ that I use all over the place that just come out of the box, it's just so convenient and easy.
4
4
4
u/vytah Sep 10 '21
Java is not a language you fall in love with, it's just a solid language that does the job. Everything is boringly solid, battle-hardened and reliable. It's not a feeling of love, it's a feeling of comfort, safety and reliance.
1
7
u/Stack_Canary Sep 10 '21
Java has existed for a long time, and is not trending in the same way as some newer languages. However, java is tried and tested, and is one of the most used languages in the world. Also fully interoperable with kotlin.
3
u/thewarlock1 Sep 10 '21
I have same doubt as well. I didn't know Java until starting my job and since then I've fallen in love with it.
3
u/kyune Sep 10 '21
Java does great things but it isn't inherently "sexy" and frankly it doesn't need to be. There are a lot of people who remember it for its problems in older versions (well deserved), and a lot of people who dislike it for not having X feature of another language.
I mean I get it, and nobody wants to be seen as being stuck on boring legacy tech but compared to the competitors the ecosystem is well-established, stable, and the development of the language has progressed significantly from its early versions.
3
u/RedPill115 Sep 10 '21
There are only two kinds of languages: the ones people complain about, and the ones nobody uses.
Bjarne Stroustrup, The C++ Programming Language, 1985
3
u/seanprefect Sep 10 '21
Java is heavy and boring and unhip. That said there's a lot to recommend java. It's everywhere there's loads of support and a lot of modern features.
3
u/kaisean Sep 10 '21
As a heavy Java user for many years, I can say that I have no problem understanding conventions used by other languages.
3
u/Hall_of_Famer Sep 10 '21 edited Sep 10 '21
First of all, not everyone dislike Java, but the ones who dont like Java tend to be more vocal about their hatred. Remember the famous quote from Bjarne Stroustrup? A language that has become reasonably popular will always receive a good amount of hatred, it cant be helped.
With this being said, its indeed a serious problem that lots of large enterprise apps are stuck in older version of Java, some even on Java 7 or earlier. Java has evolved a lot since the old days, but some companies with legacy apps will be stuck forever. These companies may be using any languages and stuck with old and unsupported version anyway, lets not forget how many companies are still stuck on Python 2.
If you are a developer looking for a Java job, theres a good chance you will end up with such a company. Its unfortunate, but it really isnt Java's fault. Its just that Java is so big in the enterprise world, that a large portion of such companies tend to use Java.
3
3
Sep 10 '21
I like Java/the whole JVM ecosystem, but historically homegrown Java code is the worst, nastiest garbage I have to work with.
When a noobie writes, say, Python, it usually comes out reasonably easy to refactor. At the very least it’s pretty simple. When a noobie writes Java, it comes out as a horribly convoluted mess of bad abstractions split over a million different files. Java itself makes the refactoring a little easier (types) but… bad Java is really, really bad.
This is totally inverted when it comes to big, well-run projects, in which case I’d much rather work with Java.
3
u/halfTheFn Sep 10 '21
I worked with Java for several years, mostly in Java 8; I haven't worked with it for a couple years now.
I hated the language, and we worked to replace it with Kotlin which was Much nicer. As with others, I was working with Spring: Spring was it's own "thing" - but Kotlin/Spring wasn't nearly as bad.
Things I didn't like:
The type system caused as many problems as it was alleged to solve; and the black box that OOP was supposed to provide meant everything had to be looked inside with the debugger to sort out. Examples:
Something returns a `map`, and you call `.set()` on it - and you get a runtime (not type) error - because it was an `ImmutableMap`. Wut. It "implements" the interface with stubs that throw errors.
Null aren't handled.
You can never trust that something else with a reference isn't mutating your object behind your back, even though it shouldn't be mutable to start with. Please please give me persistent immutable data structures!
You have to fart around with number width yourself, and the surprises that come near their max/min.
Boxed primitives vs primitives can lull you into thinking things are safe that aren't: boxed Integers lower than 128 share a "constant pool" and so can be compared as you might expect with == - but as soon as you go over 128 they become independent objects compared by identity.
Classes in the standard library maintain unexpected state that only shows up in multi-threaded environments.
The. Endless. Ceremony. So much typing to get the simplest things done - and it doesn't even "increase clarity"; it just hides the parts that "matter".
No first class functions.
No object literals.
A lot of my complaint isn't even so much with (perhaps?) the latest javas - but the whole ethos _against_ functions: "Design Patterns" everywhere and when you go online and ask "Why do I need a command pattern instead of just a map of functions?" you get responses about how "javascript sucks, it's safer, you should just accept it." I have no problem with the JVM. As I said, I'm on the Kotlin, I'm intrigued by Clojure and would love to learn more, and Scala opened my eyes. But raw Java ? I'd never reach for it unless I had to.
5
Sep 10 '21
Because nobody bothers to learn the modern Java and they believe that if Java supports the Factory design pattern, they shall use it otherwise it won't run.
Since I learned Java after VB6 and C#... of course I had it at a mix of MVC and spaghetti, it ran surprisingly fast. Also modern Java supports lambdas and other cool stuff.
5
u/Skhmt Sep 10 '21
The only thing I don't like about java are annotations (besides override). I do prefer Kotlin though.
3
u/UsernamesAreFfed Sep 10 '21
I agree with you in general. But I do think annotations are great as instructions for serializers.
5
u/mahamoti Sep 10 '21
Because this is what people think Java is like.
4
u/john16384 Sep 10 '21
Looks half assed. No build script, no unit or integration tests, and everything is missing Javadocs.
4
Sep 10 '21
On my experience, people who state that java is a bad language because of [reasons], just don't know java well.
5
Sep 10 '21 edited Sep 11 '21
In my opinion, there are three major reasons that make they don't like Java:
Lacking of knowledge in programming techniques and paradigms.
Still staying with the old versions of Java, documentation and tools.
Not "using the right tool for doing the right job".
2
Sep 10 '21
It's tough developer experience but a fast runtime performance. The tough part gets lots mad!
2
Sep 10 '21
People don’t have to love Java? Much like how people don’t have to hate it?
When you are in an environment where you are rapidly learning new languages, frameworks and design patterns or having to write wrappers and APIs for interacting with legacy systems, or having to work with outdated systems directly you tend to like what is most apparently convenient and to dislike what is not.
I feel some people might dislike Java because the context that they have to work with it is with very old versions of it. And they are most likely to voice that opinion than those that dont.
2
u/stipo42 Sep 10 '21
As a long time java developer, it can certainly be a frustrating experience. Managing runtimes and features with java can be a pain, especially jumping between projects on different major versions of java.
Java also lagged far behind the competition for many years in features and takes quite a long time to compile.
The jvm can feel like an antiquated nuisance sometimes and everything feels slow.
That said there are obvious benefits to using Java, like portability, open source derivatives, and widespread community. There's probably a library out there to do whatever you need to as well.
2
u/Pflanzmann Sep 10 '21
You can not generalise it like everybody here does.
I dislike it because i coded a lot in Kotlin, which is just java in modern and i feel like other languages like Rust, Swift or Go are just nicer to write. It just misses many features new languages have and i think that should be reason enough not to love it.
Ofc many hate to hear it, but not everything can last forever and at some point you have to adopt to new stuff and maybe start new projects not the same way you did 10 years ago.
5
u/v1akvark Sep 10 '21
You can't accuse Java of missing features if you program in Go...
1
u/Pflanzmann Sep 10 '21
Never coded in go, it was just an example for a language with a more modern feeling than java on it.
2
u/cyanocobalamin Sep 10 '21 edited Sep 10 '21
They don't????!!!!
I think a lot of people without CSC related educations don't fully understand programming or have a lot of experience with professional projects. They start off with very simple tagging or scripting languages. By comparison Java seems much more and needlessly complex.
Professional developers tend to be intimidated by any platform they don't know and there is a tendency among programmers to piss on any technology they are intimidated by ( ones they don't know ).
2
u/codechimpin Sep 10 '21
People tend to hate the "norm" I think. Because big-business uses mostly Java, and the "cool techie" companies use other languages, it's more hip to hate on what the lame big companies are using.
At the end of the day, if you can support the codebase and it does what it should within the parameters of how it should do it, does it really matter?
2
u/cavecanemuk Sep 10 '21
After seeing C# codebases and tooling support, my love for Java has grown exponentially.
2
u/Ok_can_you_improve Sep 10 '21
There are too many people and companies using it. Assuming that there is an equal probability of people not loving it, the total population of these people can be huge. (Just a pure stats view. :)
2
u/MacaroniNuggets Sep 10 '21
To be honest, I think it's because a lot of especially younger people (including me, I'm just here because of school) have never been told or presented a project where Java is the "right" language to use, aside from like Android development or Minecraft modding because they are already in Java. Want to work on the web? Use JavaScript. Interacting with hardware or need low level? ASM/C/C++(?) will probably be helpful. Are you a researcher? Learn python. Game dev? C#/C++ are used by the two biggest engines. But where does Java fit in? I still don't know the answer, but I would love to hear opinions. Personally, I think that the cross platform aspect is not enough to sway anyone that I know, but that's probably not true for everyone either.
1
u/Spiritual-Day-thing Sep 10 '21
You really don't know? Perhaps the use case is hidden. It is absolutely hilarious that minecraft modding is a meme.
2
2
u/kag0 Sep 10 '21
Because most people's experience with Java is not the language, it's the ecosystem.
Being tied up in a world where everything runs on runtime annotation processing is pretty hellish imo. So I can see where people come from.
But to answer your question, no, there's not a specific reason. Lots of different reasons for different people.
2
u/_trop_ Sep 10 '21
16 years of working with x y and z shitty frameworks and languages and Java is the only thing I enjoy working with.
Now all my backends are Spring boot. (9 large corporate systems and 3 private projects)
2
u/_arrakis Sep 10 '21
Started with Java then moved to C# with all its syntactic sugary goodness. As the saying goes, if I hadn’t seen such riches I could live with being poor.
2
u/kidfromtheast Sep 11 '21
I work with Java (non-framework) and JavaScript (strictly with framework).
I actually love Java more than JavaScript.
From the code perspective, Java gave you control whether you want to use blocking IO or non blocking IO. And you can write easy to understand code because everything is an object (well.. 97%).
From the architecture perspective, it's the microservices era. Java Thread is essentially the OS thread (sort of...). Anyway, it's not performant enough if you use the Java Thread to handle each connection / request on separate Thread using the Java SE's blocking IO ServerSocket.
So... people came up with tons of "hacky" solutions. Oracle created the non blocking IO ServerSocket version which is the ServerSocketChannel. Erlang created the Actor model solution, and the Java people started using it as well, in Java.
In short, Java is very flexible and the de facto way to solve a problem is to abstract the code, and that's makes the code harder to read for some folks. So... people hate it.
So for newcomer, it is not worth it to learn Java in the era of microservices. At least until we have Project Loom released. Maybe then we can write a very simple code and still scalable.
2
u/Ailiyak Sep 14 '21
Actually they do.
Java is the only language with a huge Java User Group ecosystem. First this is an officially registered groups and each country have at least 1. Most of this groups are organizing a non profit annual conference.
There is no other language that I am aware of that has this.
Also Java has a Java Champions label that are selected by the community, not by some company. Most other languages have some sort of MVP which is more a business label by the company ( for example MS) and not a real community label.
Java is still the most popular language not only because of the amount of projects writen in it but because it is the easierst language to start with, it has the less keywords then any other language and it is type safe.
So I can say actually I think Java is the most loved language ;)
3
u/antennen Sep 10 '21
I have done professional Java for a few years now (latest version) and I hate it. I've been doing C++, Python, JavaScript, Rust and other languages before (and all of them of course have their own set of problems). To me Java is a language that does most things OK, but doesn't excel in any particular area.
Things I don't like:
Everything is an object, except when they're not. I'm looking at you primitives
Anything can be null
Record classes are pretty cool, but they are awkward to work with since there is not built in way of modifying them (like a builder).
overlyDescriptiveMethodNamesThatActuallyMakesThingsMoreConfusing() (this is culture rather than the language itself, but I still have to endure it)
Documentation is very awkward to find and browse (I can't rely on the IDE when I want to link to documentation in a merge request)
Type erasure makes it hard to design nice APIs for certain use cases
No good way of doing async programming (Loom is not here yet)
There are Iterator and Stream, but they are subtly different and can't be used interchangeably
IntStreams and map don't play nicely without boxing (again the generics vs primitives)
Gradle is a nightmare (very lackluster documentation and very fragile)
Maven is more solid but has a very awkward XML syntax (and the documentation is really bad here as well)
People keep saying there is a great eco system but that doesn't match my experience. I wanted to do some work with STL files the other day and I couldn't find a single library for Java, but I instantly found it for both Python and Rust). This has been the case for most things I've looked for.
People keep coming up with code gen or bytecode manipulation because of syntactic shortcomings (Dagger and Lombok)
FFI (interfacing with C libraries) is a major PITA
It doesn't spark joy
If I want to test something quickly I reach for Python. If I want to build something robust or lower level I reach for Rust. Right now there is no area where my answer would be "Java would be a nice fit". It has spent too many years in stagnation and now it's just playing catch up.
3
u/dontcomeback82 Sep 10 '21 edited Sep 10 '21
My issues with Java are mostly not with the language itself but the culture around it
I don’t like using an IDE and while it’s not required for Java in practice it makes coding Java a lot easier
Popular libraries are confusing, overly complicated, lacking clear examples/easy to read docs
I’ve seen tons of Java apps in the wild that have slow boot times, terribly noisey logs, and are memory hogs. I realize these are solvable problems, but the are common nonetheless
I’ve observed often in Java codebase tests are an after thought for whatever reason
To be clear there are plenty of good things about Java too, but I have a preference for other languages (go atm) and would avoid large Java projects/shops if I have options. For me it’s just not fun to code in
2
u/Liorithiel Sep 10 '21
For me it's mostly lack of easy options for metaprogramming and glass ceiling on available performance. While the latter doesn't come often (we're switching to C++ for the most critical parts of the code), the former is just tiring.
2
u/livrem Sep 10 '21 edited Sep 10 '21
I think Java is fine at work and have used it for many years on and off since around 1999. But for the last 10 years or so I began using other languages that I like more for my hobby projects. I used to use Java both at work and at home, but it was a long time ago since I liked the language enough that I would prefer it when I have a choice. I can see the arguments about large projects etc, but none of that really applies when I work on something in my free time, so Java became just something I do to pay the bills. I do not hate it, but I definitely do not love it. And currently I work in C++ and have not had any reason to explore Java versions after version 8, so I can no longer comment on the pros and cons of using Java instead.
There also has been some cultural issues in Java with all the design patterns and bloated XML-configuration all that. Sometimes a very simple problem that deserves to be one line turned into a huge mess of classes and interfaces and XML. It can be quite frustrating. Not the fault of the language, and maybe it is getting better, but it is definitely something that many older Java programmers will have suffered and that it is difficult to forget.
2
u/User1539 Sep 10 '21
Some Java issues are very real.
Functional programming can feel tacked on, and require a lot of code that feels unnecessary. Also, you end up with a mix of many different styles from the years, with no clear style guides.
Also, many codebases are very large when, in other languages, they would be much smaller.
Compare Java to GO for instance. For the purpose of microservices, in Java, I have seen people try to pack a Wildfly instance in with a ton of other libraries, just to create a basic 'micro-service', that's so big it's hard not to laugh when deployed. Each programmer seems to follow about 10 different personal style guidelines, and where one might NEVER use a for loop, and do everything in streams, other might not yet be comfortable with streams, or working outside of Java 8 at all.
Go, on the other hand, is very idiomatic. The preferred style is part of the language, and there's no issue with it being 'stuck' at a version, like Java 8, or Python 2.7, because they've provided tools to help people migrate their code to newer versions.
Also, they've gone to great lengths to only include new features into the language when they feel they're really, really, needed. Where, Java can sometimes feel like a lot of choices, and very little guidance.
The final result is that, if you want to create some things, like a Microservice in Go, there will likely be one idiomatic way of doing it correctly, every library and extension to the language will expect things done in that way, and be easily readable because they themselves are done that way. There is little need for added libraries, and they tend to be very lightweight, resulting in small, fast, compiled, services that can spool up quickly and take little resources.
Compare that to a lot of Java codebases trying to do the same thing, and you see bloated, slow, overly complex, code ... sometimes unreadable from one developer to the next.
One of the issues Google wanted to solve with Go was that it was taking good, well educated and trained, software developers up to 6 weeks to get used to reading a codebase before they could contribute to it!
By focusing on standards with Go, a developer who knows the language can usually figure out the design in a matter of minutes, and get right to work.
That's not to say I don't like Java, I've been working with a dozen languages a year for 20 years, and Java is one that always has the tools I need, and there's always a good way to do whatever I want. My biggest complaint is working on existing code, where the previous devs wrote garbage, or the many, many, delivered systems in 2021 STILL stuck on Java 8.
1
u/wildjokers Sep 12 '21
just to create a basic 'micro-service', that's so big it's hard not to laugh when deployed.
Would just like to point at that "micro" in microservice doesn't refer to the size of the deployable artifact, rather it refers to the size of the problem domain.
2
u/User1539 Sep 12 '21
I'm just saying, if each api call requires spinning up something the size of a small monolith application, you've probably missed the mark.
→ More replies (2)
1
u/jThaiLB Sep 10 '21
Some ppl I knew said that they did not enjoyed the strict type and Java was too “formal” for them.
1
u/bonusmyth Sep 10 '21
I'm guessing most who hate Java do so because it's not like some other language they'd already learned. I'd say most people who learn Java maybe only after C have no great objection to it.
And there's nothing special about Java in this respect. I'd say the probability of disliking any language is proportional to the number you've already learned.
1
u/Vulcalien Sep 10 '21
Personally, I prefer other languages with more freedom. In particular, C. I can cast any struct to an integer, if I wish so. And having pointers is such an useful thing. Another very important thing: Macros, or in general, a preprocessor.
1
u/snot3353 Sep 10 '21
It's popular and common. Anything that's popular and common generally gets a lot of hate.
1
u/MrPotatoRice Sep 10 '21 edited Sep 10 '21
I know quite a bit of Java and have even took an oracle exam on it. I was annoyed by a lot of minor design decisions which can because of historic reasons and some not. I had a lot of trouble tracking state majorly because of OOP. Since I was surrounded by imperative programming languages, I thought "Okay, I'm going to have to live with this and I can't do anything about it". Then I came across Functional programming languages and then Lisp and it had many of the things I PERSONALLY liked. I couldn't (again, personally) solve some problems in an hour whereas in Lisp (with only 2 weeks of experience) could solve it within 5 minutes. The reason I don't really like Java is because of some of its design decisions and because it relies on OOP which I don't like, or better put I don't like the way Java IMPLEMENTED it. If you don't agree with the latter, you could read up on this: OOP the Trillion Dollar Disaster
And I agree with this specific part a lot: "I’m not criticizing Alan Kay’s OOP — he is a genius. I wish OOP was implemented the way he designed it. I’m criticizing the modern Java/C# approach to OOP."
Also: Negative Quotes on Bad Implementations of OOP
Especially with the last quote: Alan Kay: "Java and C++ make you think that the new ideas are like the old ones. Java is the most distressing thing to happen to computing since MS-DOS."
Again, this is all my opinion and I don't hate Java rather I dislike it, because for me, programming is about productivity and writing easy good for humans not computers.
Edit: Clarity
1
Sep 10 '21
I'm aware that Smalltalk exists and some of its (pretty cool) features, but what makes Java OOP different from Smalltalk OOP? I know Smalltalk is built in the idea of passing messages, but what's the big difference between message passing and calling methods on objects?
1
u/MrPotatoRice Sep 11 '21 edited Sep 11 '21
I have never used smalltalk before, but I can say that in Java everything is really forced to be an object. Whereas in Most lisps (I'm taking common lisp as an example) nothing is forced, we can do everything in one paradigm or multiple. You could take the CLOS as an example to compare from Java's Object system. I think Java has taken the OOP paradigm to an extreme, and has forced it to a point where most of the benefits of OOP fade out.
With all the objects and methods and variables in each object, there are so many mutable states to track and a million bugs I have to face everyday. Why not make life more simpler and immutable with less bugs?
Thanks for your reply.
Edit: Second Paragraph Edit2: Clarity
1
Sep 10 '21
Because simple tasks like acquire a continuous stream of an external process becomes a many-days task and it's really difficult to find proper good code bases to be inspired of.
1
u/bytebl Sep 10 '21
Java has an image problem. Plus, a lot of programmers that quit using are unaware of the progress Java has made since Java 8.
1
u/PhonicCanine Sep 10 '21
I don't hate Java, but type erasure, as well as not really allowing useful value type operations (like C# does), just annoy me a bit.
Certainly still prefer Java to a language without a strict type system though.
1
u/Maou_Diablo_ Sep 10 '21
Lol. Unlike others java was my first prog. lang. coming from EEE background and wanted to make a career shift. Yes java felt weird and forgetting sometimes like I just finish some topic but it was like I didn't finish it at all.
So I went on like this for 3 months doing only java and then things started to flow in.
Once u start getting used to it u realize that java is a bigger game and u dont want to lose the game
So guys this is how I felt learning java and I really love it so I request u guys to give it a time until it starts making sense.
1
1
u/loomynartylenny Sep 10 '21
Well, for me in particular, I guess it's a matter of what use case I generally use Java for.
If I'm trying to cobble together a quick and dirty script to do a thing for me for shits n giggles, I usually use Python because it's easier to set up a quick and dirty thing for shits n giggles with that than Java.
But, if I'm trying to do something more serious, I'm going to be using Java instead, because Java tends to be a bit less unwieldy for that sort of thing. But, as it's not a shits n giggles thing, it does feel a bit less fun.
1
u/paaave Sep 10 '21
It's like with any tool. When you need to do some gardening in your backyard you wont get a full sized excavator. You wont cook your sunday family lunch in a 100l pot and so on... Whenever someone says "i dont like this and this tool" either the tool is not corectly chosen for the job, or they dont know how to operate the tool...
1
u/sinnerou Sep 10 '21 edited Sep 10 '21
Take this with a grain of salt, it's just my opinion.
There are a lot of things I like about Java but it is not the easiest language to work with, even with large code bases in my opinion. The problems with the language itself are minimal and they are made up for with some awesome benefits. But here's what I don't love.
Language:
null objects and null handling
method overloading and no default parameters
datetime handling (legacy still problematic)
repetativeness/boilerplate/excessive verbosity higher than other languages and can make code difficult to grok.
functions feel second class
checked exceptions
There are a lot of pros compared to other languages as well but that's not the question. The language itself imo is not a great reason to dislike Java.
That brings me to the ecosystem. Java is old and the ecosystem outside of Spring is... challenging compared to other languages. The ecosystem is imo a valid criticism and a reason one might not to work with Java.
Ecosystem outside of Spring:
difficult to find good packages
difficult to find the right versions of things that work together
documentation is frequently minimal or not accurate
error messages are often unhelpful
packages and systems are not kept current e.g. most documentation and packages work with java 8, junit 4, aws sdk1, etc.
xml everywhere
You won't notice this stuff if you've been working with Java on the same project for ages or if you only work with Spring. I can count the number of times I've needed to use the debugger to figure out why a package just doesn't work in any other language on one hand, however, it's almost routine with Java.
Finally, the JVM seems less useful in a world where docker is the norm. Graalvm seems cool and Kotlin looks awesome but I haven't built anything large with it.
1
u/taftster Sep 10 '21
Why do you have to "love" a language anyway? It's just a tool. I think the love can get in the way with evaluating a language on its merits and applicability to the problem one is trying to solve. It causes blind spots and biases to be in love with a language, and eventually transcends into religion.
Specialize in one or two languages. Be comfortable reading and appreciating a few more. Learn design patterns and clean code ideologies which are applicable to any language or platform.
1
1
u/sintrastes Sep 11 '21
I hear a lot of people saying things along the lines of "Because they use Javascript", "They think dynamic typing is more flexible", "They've never had to maintain old code", etc...
I don't love Java because it's type system is not powerful enough for my taste. This lack of ability to express invariants at the type level leads to error prone things like manual type-casting.
And yes, verbosity is a reason I dislike it sometimes too. But that has nothing to do with static typing. Lack of certain features (e.x. typeclasses) leads to a lot of boilerplate.
I also hear a lot of "They just like the hip new things". Haskell, much like Java, is a 90's baby. ML came out in the 70s. Both I "love" much more than Java.
To be fair, I don't hate Java. I've seen some truly great code and beautiful APIs written in it. I just don't love it either.
1
u/i_ate_god Sep 11 '21
Older versions of Java were mind numbing in their verbosity. That always turned me off.
1
Sep 11 '21
This is a question designed to imply that people don't love it. There are millions of people who do love it. I myself being one of them.
1
u/Comprehensive_Idea98 Sep 11 '21
Java is pretty good. It's not the best, but far from the worst. It is fast for most cases you would need.
1
u/DJDavio Sep 11 '21
I love Java like I love a hammer or a screwdriver. It's just a tool. Some tools are more useful or sturdier than others and I would use them over most other tools if I can, but if some day I find a better tool, I would just use that probably.
We as developers should not get too invested in our tools as we keep inventing new ones. Given our recent history, it's unlikely that Java will be around in 50 years, but maybe it will.
As a developer, I am not paid to write Java code, I am paid to solve problems. As long as the problems are solved, the tool doesn't matter much.
1
Sep 11 '21
Its way more than a tool. It is a miraculous invention made of pure genius. It is an unbelievable platform. Incredible!! I constantly marvel at what has been accomplished.
1
u/wildjokers Sep 12 '21
As long as the problems are solved, the tool doesn't matter much.
You must be a contractor. Dump a pile of shit that solves the problem with total disregard to whether it is maintainable.
1
u/DJDavio Sep 13 '21
Well that's not what I meant. What I meant was that the technology, language, framework etc are just means, not a goal. There is no point in getting too emotionally invested in a technology as those are always temporary.
1
u/fullrank Sep 12 '21
TL;DR it's really just self-hate.
Java is one of the most popular techs and therefore most have had to use it.
For many, this was not their first tech "love affair".
They know the other tech well, and are frustrated that they can't do things in some new tech as easy as they can with their "first love".
Also fixing a bug in a 1 million LOC app is going to be harder than fixing a bash script.
1
u/97hilfel Sep 12 '21
A few reasons I dislike Java are the following:
- The lack of a central, proper package/library manager
- The ways Java applications get built and are "compiled" is rather complex, I hope jPackage will solve some of these issues.
2
u/wildjokers Sep 12 '21
The lack of a central, proper package/library manager
What? Maven central is the de facto standard.
The ways Java applications get built and are "compiled" is rather complex, I hope jPackage will solve some of these issues.
Again, what? It's not complex at all. Build tools take care of everything. Follow the conventions and there is no work involved at all.
FWIW, "jpackage" has been around since Java 8 (called
javapackagerthen). It went away in java 11 when JavaFX was removed (because technically it was part of JavaFX). Then came back in Java 14 asjpackage.1
u/97hilfel Sep 12 '21
> What? Maven central is the de facto standard.
Exactly! De-facto standard, not standard, unlike NuGet, NPM or the Python Package Index.
I personally had nothing but issues building JavaFX applications, if you want you want to give me a helping hand, i'd highly appriciate it.
→ More replies (1)2
u/wildjokers Sep 12 '21
I personally had nothing but issues building JavaFX applications, if you want you want to give me a helping hand, i'd highly appriciate it.
Not sure if you are using Gradle or Maven but if you are using Gradle this is all you need to build a modularized JavaFX app. I highly recommend to use java modules for JavaFX apps so you can get a small runtime (can do it without modules but is easier if you use modules). Simply execute
./gradlew jpackageto get a app with a bundled runtime appropriate for your platform. If you just want a build image but not packaged execute./gradlew jlink. This is tested with Gradle 7.2 and Java 14. You will need to add the JavaFX modules you need.plugins { id 'application' id 'org.openjfx.javafxplugin' version '0.0.8' id 'org.beryx.jlink' version '2.24.1' } repositories { mavenCentral() } javafx { version = "13" modules = [ 'javafx.controls' ] } application { mainModule = "com.your.main.module.name" mainClass = "com.your.ClassWithMain" } dependencies { } jlink { options = ['--strip-debug', '--compress', '2', '--no-header-files', '--no-man-pages'] launcher { name = 'NameOfYourApp' } }→ More replies (3)
1
u/cryptos6 Sep 13 '21
I think the reason for this perception is a mixture of several things:
Java used to be very cumbersome, even simple event listener callbacks ("onClick") required an (anonymous) class instead of a simple function (possible since Java 8)
The OOP and pattern fetish made same things ridicoulus complex
Frameworks tend to be very complex - just enjoy your next Spring stacktrace in detail
Some design choices were questionable and made working with the language partly annoying: null, no unified typesystem (but primitive types and reference types without a common super type), some weaknesses reagarding generics, no functions as first-class citizens
However a lot changed beginning with Java 8. Although I wouldn't say that I "love" Java, it is a very decent language, but most people are stuck somewhere in the past - and some are repeating memes without actually knowing (modern) Java.
1
u/daddyd Sep 15 '21
persistent, old, no longer valid, judgements. (you know, just like linux is only command line, hard to use and needs to compile everything from source) a lot of those still live on today.
also, maybe, people who came from other languages which were easy/simple enough not to need a IDE. tbh, i wouldn't enjoy java much if it didn't have all these great IDE options. something i don't really need when programming in python for example.
1
1
u/DjangoPony84 Sep 10 '21
Experienced Python developer here who has also done some Java work.
The language is fine, if quite formal, and I do in fact appreciate static typing etc - it's the codebases that often are the problem. It's a crapshoot between something well engineered and tested and a million lines of absolute spaghetti where the wheel is reinvented multiple times.
1
u/tonyveo Sep 10 '21
Java was first released in 1995 and since then a lot of new ideas have been developed in the language design world. Java is maintaining backwards compatibility to 1.0 release, which in my opinion, makes language development slower and harder. The result is Java feels old, cumbersome and verbose comparing to languages that were developed recently.
1
1
1
u/Serializedrequests Sep 10 '21
Well probably inexperience. I don't have a lot against java as a language (just need data classes, easier immutability, and better null handling to be truly enjoyable), but Spring Boot is making me insane right now. I don't like annotation driven forms of java very much. They all stink of trying to make the language into something it isn't, and cause all kinds of unexpected runtime errors.
I would also move the type declarations after the variable name, like Go or Typescript. I have come to realize that this dramatically improves readability for me. But I can't fault them for going C style at the time.
-3
u/Frapto Sep 10 '21
I am a junior dev working in java (spring & spring boot) and quite frankly I don't like it. Here is why:
stuck with old versions (7&8)
The amount of libraries there are out there. Many view this as a good thing but I don't. Not trying to start a language war here but compare that with C#. Almost everything I need has a library either directly created by or recommended by Microsoft. I certainly don't need 100 different ways to do the same thing.
security. Spring security is good at its job, no question about that. The issue is with configuration. You need to chain some builder pattern with ant matchers and a whole lot of stuff. In Asp you only need to use the [Authorize] directive.
the jvm... Good luck figuring out what an exception actually means when the message isn't too clear (thrown from tomcat or other code). The only tech I dealt with that has worse error reporting was angular.
baggage from the past. Too much deprecated or not-recommended-to-use classes that only exist to not break legacy code.
let's not get into the datetime mess
documentation. Documentation is hyper huge which means huge time investment to learn to do things the spring way. You certainly don't need the same time investment to learn the same things in most of languages.
personal preference but lack of something like LINQ is also a minus in my books.
Summary: Java isn't terrible. I certainly see its upsides but compared to something like Asp (core) it is just unpleasant to work with.
Note: I use Asp core as an example because that's what I do as a hobby now but I am aware that it has its own issues. However, compared to java which I use in my day job, it is a world of bliss.
5
u/razsiel Sep 10 '21
For point 8 (if you're on Java 8) there's the Stream api which is similair to LINQ for dealing with collections.
→ More replies (2)
-2
u/Philluminati Sep 10 '21
One other reason is that people have fallen out of love with Object Oriented Programming.
Inheritance is poor mechanical for reusing code
private and hidden state inside classes/objects makes reasoning about parallel processing and multi threading difficult
mutable variables have potential performance problems maybe too.
try catch / exceptions are a confusing escape hatch that can corrupt data structures, exposes side effects and hurts the substitution principle. They are difficult to reason about.
And Java is was built around those concepts. It has become more modern and moved away from these things buts still considered an OO language, even if it has adopted a few FP things like map and option.
10
u/RhoOfFeh Sep 10 '21
The whole notion of functional and OO precepts being at odds bothers me. I think this is because people don't well and truly understand that the main point of OO is messaging, not inheritance, not composition, not any of the other stuff that are really just implementation details.
I didn't make this up. Ask Bjarne Stroustrup about it. He's got a one hour video up on Youtube about doing OO without inheritance.
→ More replies (1)
56
u/cosmin14 Sep 10 '21
maybe because some are stuck with old version of java.
and some rants on the Internet about Java and how cool is <insert_hype_stack_here>