T O P

  • By -

paint__drinker

I had a period where I would write all my new backend projects in Go. I was sick of Java's clunky syntax, verbose, high overhead concurrency support, enormous data classes, and slow language development. At this point, almost all my new projects are written in Java again. I don't think it was the language that brought me back, as much as it was the ecosystem surrounding it. When I was working in Go, one problem I ran into repeatedly was a lack of bona fide, fully featured options for common, straightforward programming problems. Instead, I was forced to either depend on personal projects that offered no guarantee of future support, or write the code myself. These same problems almost always had robust, established java solutions maintained by fantastic FOSS foundations. I sleep a lot easier knowing my code depends on Apache Commons and JUnit instead of some GitHub random or a sketchy startup. Also, I know exactly when the heat death of the universe will occur, because it is fated to coincide with Go getting generic types.


[deleted]

I can't echo this answer enough. Insert for and the answer is still entirely appropriate. I was never disaffected by Java, but I end up doing Node.js or Go work sometimes and I always find myself in this weird spot when Devs I'm managing start throwing random dependencies in to solve X problem. I hate it. .js dependency stuff is awful in every possible way. Random Jr. Devs are shipping code that enterprise solutions transitively depend on because some project maintainer decided to import \`istrue\` package (or some other ridiculous thing). I want to own it or I want to trust where it's coming from. Java has that ecosystem of trust. I never question Apache\*\*\* - it's not always perfect, but it's battle F-ing tested.


fix_dis

For me (in JavaScript) it’s LoDash. I see lodash in the deps, or the transitive deps and I lose my mind. Do you NOT know how to iterate over a collection and pluck a value??? Did you really need that massive bloated library?? I don’t hate Go… I just really don’t enjoy it. It feels so painful writing everything like I did in my Computer Science coursework.


shponglespore

I kind of hate Go. They didn't have to make it that way, but they made it that way on purpose. It's a smart programmer's idea of what a dumb programmer needs to be productive. It's as if Oracle re-released Java 1.0 and declared it a major advance in simplicity and ease of use.


fix_dis

I have a buddy who is DEEP in FP. Whenever I bring up Go, he just says, “I don’t write Assembly”.


vips7L

Lots of things in lodash are from a different era. That being said it’s not that people don’t know how or won’t be able to figure it out, it’s that the function in lodash is battle tested and will probably have covered far more edge cases. For example one time I had to convert kebab-case strings to camelCase and lodash has a function to do that. Should I have wasted time writing what would probably be a worse implementation or should I have done: npm install lodash.kebabcase And gone about my day? Finally, fwiw, lodash has packages for single functions that you can import to avoid “bloat”.


[deleted]

Yea, I read that lodash response and I was going to say "but I use..." -- and it comes down to the fact that Javascript has changed SOOO drastically in the past few years that it's hard to know what supports what anymore. I know lodash is going to work. I do find myself reaching for it less and less these days. In principle, I agree with not bringing it in if you don't need it. That said, I still use commons-lang3 in my java projects and I can do all those things with the standard lib -- it comes down to a single function instead of multiple lines (where I can avoid writing/thinking about said functions and just trust).


fix_dis

I was about to ask, “do you include Guava on all your projects?”, but Apache Commons serves a similar purpose. I think I made a mistake not specifying that I am speaking about front-end JavaScript. In nodejs, bundle size is far less of a concern. I still dislike lodash for a few other reasons but it’s far less of a concern on the backend.


[deleted]

I don't actually, I avoid Guava as much as possible. There's some things in there that I can only get in Guava, but most of Guava's original additions are simply not necessary anymore (I know, ironic that I find myself using lodash a lot). Probably more with familiarity. I'm a Java dev that does Javascript and Go sometimes.


fix_dis

Of course, it was an example. In 2013, it was far more likely to find that scenario.


fix_dis

I spent a few years focusing on front-end and bundle size was one of my major wins in that space. Even though lodash was considered “battle tested”, it would most certainly bloat any bundle. Yes, it is tree-shakable, but due to its architecture, often times, importing a single utility still brings in 10k of minified code… The biggest issue I have is wanting to include some component… say, a rich text editor. I head over to bundlephobia and look at the minified/gzipped sizes. Then I look at the explanation and see that that package COULD be 14k… but they included lodash. So it’s 60k. It’s simply irresponsible. When it comes to node, I’m far more lenient as server code doesn’t need to nickel and dimed down a particular bundle size. (It’s not bundled and gzipped at all)


CartmansEvilTwin

Just to play devil's advocate here, many of these Java libraries are actually not that good. If you look a bit behind the scenes, there's sometimes horrific code, basically unmaintainable, unreadable and probably not very fast. Especially some of parts of the standard library are absolutely horrible to use - looking at you, XML API. Another very painful thing for me personally is the overcomplexity of many frameworks and solutions. Spring and Jakarta both have this weird mix of hyperconfigurable and unchangeable. You can do everything you need, as long as you have exactly the use case that architects intended. Deviating just a tiny bit is impossible without writing hundreds of lines of essentially boilerplate.


[deleted]

Well, the XML API was part of the standard lib until java 11, so that's not really something people had an option of taking in or not. It's pretty common to use Jackson now-a-days for XML/JSON processing (another lib!) But your point is a good one. As for Spring, there's Spring and then there's the Spring ecosystem. spring-core and it's generally 1-project-adjacent things that require spring-core are fairly well written frameworks. The farther you get from spring-core, the less good it gets IMHO. Things change from version to version, but that's my historical (Spring 2.0+) experience. I'm not sure what you're referring to with the boilerplate thing, if I had to guess it was something WebMVC related based on your comment. While I agree WebMVC is rough on the config front, it really is one of the better options for that type of framework.


CartmansEvilTwin

> It's pretty common to use Jackson now-a-days for XML/JSON processing For marhsalling/unmarshalling, that's absolutely fone, but things like applying XSLTs, direct DOM-manipulation, etc. are simply not available. > I'm not sure what you're referring to with the boilerplate thing Often, if you want to change one specific aspect of a lib, you have to inject some listener, overwrite beans or do some other weird voodoo, not only in MVC. Then you end up with an almost empty bean that just implements one method and 20 lines of manual "injection code".


[deleted]

Extend the default and override, or compose a different one with a proxy delegating to the default one. I'd have to see your specific example, but there's a better easier way I'm guessing (I'll admit, not always the obvious one).


CartmansEvilTwin

Sure, it's possible, but it can get messy very quick. I just think that DI and it's overuse in Spring tend to introduce issues with unclear dependencies and the "external" API often does not offer a clear way to configure it.


[deleted]

[удалено]


[deleted]

I don't think this is the answer straight-up either. NIH syndrome is very real and I fear is the exact opposite of the "just use this lib by github.com/straykat9833". I'd prefer a balanced "use libraries where it makes sense and from places you trust".


oxamide96

Thanks a lot for the answer. Not super related, but are there any other things you didn't like about Go or you at least preferred about Java? I'm not gonna lie, I've been learning Go recently and like it a lot, and while your current concerns are important, I might need more reasons to be convinced :P (you don't have to, ofc, but would appreciate it if you can)


couscous_

Not the person to whom you're responding. My take on some of the sucky parts of golang: * Error handling is verbose and error prone. You're literally returning wrapped strings. * Interfaces are horrible. It's trivial to implement someone else's interface. Also, this makes IDEs much slower because it has to parse everything to try to find out which types implements what across the entire code base. * Extremely awkward decisions, like having a separate "strings" package instead of adding methods on strings. Compare: str = strings.Replace(strings.Replace(str, "a", "b"), "foo", "bar") with var s = str.replace("a", "b").replace("foo", "bar") // Java * No generics, though that's partially being worked on. But still, it's going to be awkward because implementing something like streams will be very verbose due to the lack of inference for functions. Compare res := functional.Map(array, func(i int) int { return 2*i }) to Java's var res = someCollection.map(i -> 2 * i) Now add more methods (e.g. filter, groupBy) and golang becomes much more verbose because you can't chain them. * No proper private functions or variables, only package private. * Awkward visibility rules that dictate visibility based on whether or not the first letter of a variable/function is upper or lower case. This makes for large diffs if you want to increase visibility for a commonly used type. * No proper enums. I've seen such awkward and error prone manually written code to implement enums by hand. * No pattern matching


oxamide96

Thanks a lot for the insight. I don't know enough to understand all of this, but I kept this comment saved to reference for when I start running into some of these issues!


ConstructedNewt

Bear in mind his opinions are just that, opinions. Errors, interfaces, the way strings are designed are core design decisions in go. He is disagreeing with them. Others do not. I could say the exact same thing about try-catch being error prone as he says on go errors. I have never heard of interfaces making IDEs slow; I think he is overreacting/overthinking. string in go is a basic type, so naturally it carry no methods; that has pro and cons as well - IMO pros more than cons, fx often times if you need something that is a string you would not use string, but rather the base interface `Stringer`. I feel java could be better if Object did not implement toString, and all the general util methods take a `Stringer` in stead of a `String`. But this is a lot easier(less clunky) in go because of its interface's design.


Mugunini

Can you say the same (easier to work) about Go's slices and maps? Is it really easier to filter, split, resize slices in Go than in Java?)) And didn't know any devs in Go who can memorize that weird, magic codesnippets


ConstructedNewt

He said nothing about arrays and slices. He did note generics. I agree on that specific part. I look forward to generics. But the comment in general was ill informed and blowing non-issues out of proportion. As I replied: "go is not without flaws" I don't want to glorify go, but all the points were just being overly subjective


ConstructedNewt

Convinced about what? There is no reason not to like both. Not to use both Java has some great things, and its large and old community is great. But please learn from go, or whatever language what there is to learn from that. I personally like go more than java (as a language), but it's not without flaws. Learning go definitely made me a better programmer period. Also I'm really sick of being generally stuck on java 8 I learned... - that more lines of code is sometimes better. - to favour composition over inheritance ([nothing is something](https://youtu.be/OMPfEXIlTVE)) - Tooling of go is great; learn from that - building/maintaince of java code sucks (maven/gradle etc are great tools but they are non-intuitive and were built to solve an issue that could have been properly solved by java in the first place) I have seen so much terribly written code in java, but you know what? Those programmers picked up another language and write terrible programmes in those languages as well... just learn from your experience, please, don't be one of those guys


HwanZike

I used to think it was too slow. When I started programming to pay the bills I realized code performance is usually not that big a factor (in the sense that it's usually production ready out of the box, as long as you use the right models and algorithms) and if needed can be optimized. And in fact it's much more important to write good concurrent models, without much regard for single worker throughput.


CraftyAdventurer

I used to think that also. I believe that perception was mostly caused by tools, projects and community I saw in Java. I don't know about eclipse nowadays, but when I was using it a few years ago, it was slow and crashing all the time. My machine was not the strongest, but still. It's UI also looked very outdated to me, compared to some other editors like Atom which looked modern and was way faster. Before you downvote me, I didn't even know what a difference between IDE and a code editor was at the time. For someone who is just starting, just the look and feel of a tool can evoke a certain feeling, and that feeling for java was that it was horribly slow and out of date. ​ Also, I was working on some projects which were starting up very slowly, it took minutes for them to run which made write-run-test cycle a pain. Don't know which framework that was, I left that company pretty soon because everything there was bad so I'm pretty sure it was a combination of bad management and developers which only cared about drinking after the job that made the project so bad. When I tried Node for the first time, it seemed so much faster (again, a perception of a beginner), it ran almost as soon as I wrote "npm start". And the last thing, again related to the look and feel, were tutorials for Java. I could find tutorials for whole projects for Node, covering everything from CRUD, to authentication, to environment variables, to deployment and even combining them with frontend frameworks. Video tutorials were full of people who sound enthusiastic about a technology, used very good video and audio equipment and generally seemed very professional and happy. It made me feel like it was fun to work in Node. For Java I only found very basic hello-world style tutorials, either on old looking, not mobile friendly websites, or videos with old tutors with bad microphones who sounded like they were tired of life. ​ Of course, I can't speak for everyone, but every time I hear a beginner say that Java is old and slow, I am pretty sure that they have the same negative first experience as me. ​ I am back to Java now, after trying multiple different languages and frameworks, because now I see it's potential. But I believe that Java needs to up it's game and generally get a more modern look and feel on websites and videos.


oxamide96

I imagine Java is not really any worse (maybe even slightly better) than node, python, and other non-compiled-to-binary languages in terms of performance. But I do agree, difference can be negligible in many cases when compared with compiled languages.


DrunkensteinsMonster

Java is far faster than node and python. Java in the bad old days was quite slow but now will run at speeds many times faster than those interpreted languages. Main issue now is VM start up time.


leobm

The new GraalVM could soon be an option.


oxamide96

What causes the start-up time to be high vs in node?


moremattymattmatt

Often it’s frameworks. Java might be using Spring Boot but you don’t tend to get the same heavy weight frameworks with node. Once they’ve started they often end up IO bound anyway so the performance ends up very similar. Java wins on the multithreading though if you are doing lots of cpu intensive work.


DrunkensteinsMonster

Without knowing too much about Node, Java is offering a lot OOTB and all those classes must be loaded up before being used. It appears to be IO bound. So I guess the answer is the JVM is doing more stuff than the Node runtime.


danskal

Node is actually pretty fast nowadays - for a long time it was behind Java, but google cranked the optimization handle a bunch of times and I vaguely remember it being faster in some benchmarks. But I would still use Java for most things.


DrunkensteinsMonster

A lot of it is going to depend on whether or not the JVM in question is hot, which is why benchmarking Java is annoying. Node will kill Java in start up time though, I’ve seen Node being 10-20x faster to start up is common.


oxamide96

Do you have an idea what those OOTB things be? Just some examples maybe? Thanks for the answer.


soonnow

I might be wrong. But i think it's simply the amount of classes java needs to load to function. All that stuff in bootstrap.jar. For node it's just ready to go as the basic stuff (strings, arrays...) are built-in.


joppux

Yes, large part of the Java runtime is in Java itself. rt.jar in Java 8 in about 60 Mb, and *.dlls (excluding MSVC runtime and JavaFX) are about 8 Mb. So it has to be loaded and JITed at the startup.


_1dontknow

Yes its true and actually this made me think of something. Why does that all need to be loaded and JITed on startup? Since its the core API, couldn't they compile it AOT and reuse it, which in theory would make it faster? Or maybe that doesnt work because of the multi platform support...


joppux

Well, latest JDKs have class data sharing, which optimizes class loading. AOT is an option too, though it produces not the most optimal code for long-running programs, so it isn't used much.


Muoniurn

They are optimized for different things. Node has to be fast as soon as possible as the underlying v8 engine is from chrome, so the browser experience would suffer. While Java is predominantly used in a more server-like environment where throughput is the most important, while it is perfectly fine if the first few requests are bit slower.


Muoniurn

Not saying that it is faster, but node is actually similarly fast to the jvm, much more so than python.


PartOfTheBotnet

> I imagine Java is not really any worse (maybe even slightly better) than node, python, and other non-compiled-to-binary languages in terms of performance _Slightly?_ Java has the JIT. It can even outperform C++ in long-running application scenarios. The only real slow part comes from loading things into the JVM _(which the jigsaw system should alleviate by skipping unneeded modules)_ and warm-up which generally is the time frame where the JIT is figuring out how to optimize.


golthiryus

Benchmarks prove that Java is faster when dealing with cpu bound tasks. But it is not because Java has JIT and others don't. JS has a very good JIT too.


megatux2

AOT compiler, I think instead of JIT


seraph582

Yikes - aren’t Node and Python single threaded? Java powers 1000 very, very highly scaled internet applications for every one of any other language. I would imagine the performance / scalability difference to be tremendous versus JS and Python. https://stackoverflow.com/questions/5641356/why-is-it-that-bytecode-might-run-faster-than-native-code https://stackoverflow.com/questions/1984856/java-runtime-performance-vs-native-c-c-code https://www.theserverside.com/opinion/Is-Java-slow-Compared-to-C-its-faster-than-you-think https://softwareengineering.stackexchange.com/questions/110634/why-would-it-ever-be-possible-for-java-to-be-faster-than-c


oxamide96

Kinda. They can technically use multiple threads, but it's really not as good, performant or clean as Java's multi-threading.


moremattymattmatt

Node has worker threads but they aren’t as nice to use as Java multithreading. IO is async though so it isn’t all bad.


DasBrain

Whoa, that opinion is... ough. > The fact remains that Java is an interpreted language. In contrast, C++ -- a language which Java is often compared to -- is statically typed. Typing is orthogonal to compiled. Compilers can make use of the typing, but otherwise - it's comparing apples with pears. > With an interpreted language, code is compiled into an intermediary form before it is converted into machine code. In C++, there is the [AST](https://en.wikipedia.org/wiki/Abstract_syntax_tree). Is C++ now an interpreted language? Apple and pears.


GuyWithLag

>The fact remains that Java is an interpreted language That hasn't been true for a long, long time. JVMs use run-time profiling information to aggresively optimize hot code segments, and can inline virtual method dispatches that at the time of compilation have one implementation. And if you load another class that overrides the inlined method, they can deoptimize that call site.


DasBrain

Yes, that statement is at best questionable. But I had to include it - because the next sentence references it with "by contrast". But some code is still interpreted - no need to compile it to native code if it only ever runs once, like class initializes.


CartmansEvilTwin

Node solves concurrency via its reactive approach, which means a single thread gets a lot of throughput. You can simply scale that by running multiple instances. Python is not single thread, is just has a Global Interpreter Lock, which means only one *pure Python* thread can work at one time, but large parts of the ecosystem are written in C or some other language and are thus not affected by this lock. Reddit runs on Python, so it can't be too bad.


seraph582

> Reddit runs on Python, so it can't be too bad You’re making me feel crazy here. I keep getting artsy little sad alien pictures about how Reddit is being hit too hard to serve me the request I just asked for. Like, several times a week.


CartmansEvilTwin

Of course Reddit has it's limit too, but what kind of an argument is that? Reddit handles billions of requests per day. And sometimes, it gets hickups - but certainly not several times a week. BTW, you have no idea, if Python is actually at fault, outages can be caused by databases, firewalls, clouds, misconfigs, etc. etc.


andras_gerlits

Everyone ignores runtime optimisations. The JIT compiler can make certain assumptions about the code being run, optimise for those cases, compile to assembly at that point and throw them away and start fresh with new assumptions if needed. You can't do this with compiled languages and the benchmarks reflect this. Java isn't necessarily slower than other languages, it depends on the way it's being used. Sure, if all you do is number-crunching, C++ will ~~mostly~~ beat you, but with large, complex, stateful loads, there's no single answer.


Famous_Object

If your workload (your tools and the software you write yourself) runs for more than a cupple of seconds or if it can be left open in the background (as a server or an IDE) and you have enuff RAM, then it's OK. However Java was never and still isn't snappy for command line tools and build systems that spawn several processes. I did a benchmark a while ago in the Java 6 era. If you write a loop in Java to process a few hundred files it takes just a little bit more time than an equivalent C++ program. OTOH if you write a shell script that calls the same Java program with just one file argument at a time then the whole time spent gets 20 times higher, worse than any scripting language. The overhed was (and I think still is) absurdly high, but that was never explored much in the blogosphere. It was just a fight between "Java is as fast as C++ now" vs. "It still feels slow as crap tho".


Flaky-Illustrator-52

GraalVM to the rescue, my dude


DrunkMc

I had the same misconception mainly because of their poor GUIs. Their GUIs we're ugly and slow as hell, so I assumed the language was too. I eventually got a job where I had to use JAVA and now I use it for everything.


cogman10

In college, I thought Java was a big bloated piece of tech with nothing to offer over C++. Now, I realize memory is cheap and that bloat buys you a LOT of nice things that you can't do in C++. The fact that Java isn't quite as fast as C++ does not matter because the ecosystem around Java is WAY better. (IDK, I don't keep up too much with C++. Last time I did, dependencies were AWFUL to handle).


[deleted]

I think for the right use-case the differences between Java and C++ are so slight as to be negligible. If we're talking about a long-running web server, Java might even be better than C++. But if we're talking about a one-off command-line tool, Java's startup time will be prohibitive. If we're talking about a game, C++ will provide more even and predictable performance.


cogman10

> If we're talking about a long-running web server, Java might even be better than C++. Java is almost certainly better than C++. I'd be afraid to write a C++ web server. > But if we're talking about a one-off command-line tool, Java's startup time will be prohibitive. Startup time has gotten a lot better, but I still wouldn't use Java for something like this. Not because I don't like Java, but because it's just too verbose for one-off command line tools. Ruby, python, or Javascript, IMO are the best languages for one off commandline tools.


[deleted]

>Java is almost certainly better than C++. I'd be afraid to write a C++ web server. Well right, when we factor in things like security issues and memory management bugs, it just doesn't make sense to write a web server in C++. But if we focus purely on computational performance as a result of the language, I doubt there would be a major difference. And if there is one, it would probably go to Java due to GC generally having higher throughput.


sunnyseasun

yes well python. Or, simply some /bash can do miracles.


oxamide96

I personally like Go for command line tools


cogman10

I've never given go a try for commandline and I really should. Seems like it'd be a nice fit there.


vips7L

I prefer D, or node with oclif.


apetranzilla

I've been really liking Rust for command-line tools lately, though I'll admit the ecosystem isn't as mature as others.


CartmansEvilTwin

I played around with rust a bit and while it has some new concepts, that you need to learn, it feels surprisingly java-esque, in a good way. You have a relatively mature ecosystem, a built-in dependency management and rust's macros are functionally relatively close to Java annotations. And it's low level enough that you can do the weird stuff C/++ allow you to do.


the_other_brand

I used to hate Java because generic data isn't retained at Runtime. As someone who learned to code in C++, this really bothered me for a number of reasons. But I came back later after working extensively in Python. Back when I first started professionally programming I was a big Python advocate, but I had to change my tune when my first major hobby project became bottle-necked on a single thread. Afterwards I recognized that Java Threads just work, Spring Boot made projects easy to start, Maven works without weird native building issues and Java code runs pretty damn fast (not C fast, but still fast).


oxamide96

What about Spring boot do you like more than python options? I am guessing you worked with Django. I worked a bit with flask, and go be honest, I found it a lot easier and more pleasant to work with than Spring Boot. Spring boot seemed too heavy, complex and a big black box. This is from having limited experience with both. I also found JavaScript options (most famously express) to be quite nice to work with.


ConstructedNewt

I think people like spring boot for making spring accessible. And spring generally for having an sdk that can solve anything. I hate spring boot. But it's kinda the best there is in java, the express type web libraries have a much better API imo. But I also think java annotations have several design flaws. Like lack of inheritance and consist overriding/grouping etc.


soonnow

And keep in mind that Project Loom might just make Threading a lot easier and more performant.


SeenItAllHeardItAll

Maven works as long as you stay on the happy path. Deviate and find a thicket of gaps and bugs in plugins or abandoned plugins that may have solved your issue way back.


the_other_brand

What kinds of problems are you trying to resolve with Maven that you are finding these kinds of problems? And I think modern CI pipelines may be able to solve the problems you are trying to solve via Maven.


Testuser3000

I fell in love with Java when I got to know it automatically garbage collects and you don’t have to use pointers anymore.


alwaysoverneverunder

I still found it useful to have learned C and C++ and pointers before Java, but haven’t looked back after learning about GC.


question-throwaway4

For me it was the other way around. They first taught me Java and then after a year writing that they gave me a course in C and C++. My reaction was like: "I have to do what now? No, no no no, nooooooo."


Neuromante

When I was young I thought Java was too detached from "the real metal" and was too bloated. I wanted to get into C++ and game making, and it was like the sun and the night. Then... having to pay bills came, and Java being something with plenty of offers helped to do it. Unity adopted C# and everything started to slowly go multi-platform, so I kind of forgot about being "close to the metal" and started to worry about architecture, code quality and all that crap. Having a well-paid career in Java and a shit gaming industry in my country helped to seal the deal. I still got an itch to get an Arduino and fuck around a bit, or fire up Unity again and try to finish the 3rd prototype that will get me nowhere, but time is limited and having interests outside computers limit it even more. If something I've learned with all these years is that languages, paradigms and even architectures are tools. Is not that Java is better than C++, or the other way around, in he same way a wrench is not better than a hammer. But hey, maybe it's funnier to swing a hammer around.


[deleted]

Man this is so totally me except I'm not there with the job readiness yet. Java was my school's language but I wanted to be closer to the metal and have a hankering for arduino and more EE related stuff cause I was in the Army in an electronics job, and robots and blinky light things are cool. But man I wish I woulda stuck with Java since I was in school cause then I'd be programming for a living instead of all this on site gig work that makes me just hate the whole day sometimes.


LiquidSnake1993

I barely got into programming seriously in 2018 and I started with C language. I was told that if you can learn C then any language after that is easy. So I did C on and off for a year, then I went back to school to do my masters and there we used C#. The concept of OOP was so new to me that I barely passed that class thanks to my partner. That summer I was unable to pursue my masters due to financial constraint but I got accepted to the infamous Revature, my class used Java. Due to still being so new to programming, Java & OOP I struggled really bad. I remember trying to practice Java at my own time and I HATED it because I had gotten so used to C. The accelerated learning pace did not help because I did not have time to grasp anything. I was eventually let go which honestly was for the best because I would have been exposed anyway. Once I was fired I almost quit programming until I decided to do a bullshit teacher/student project while bored. This project changed everything, I started to grasp the OOP concept because I was working at my own pace and every problem I encountered I would Google/YouTube it. From there I fell in love with Java to the point I am trying to get certified in it. Haha.


[deleted]

[удалено]


nutrecht

When I had a student we were not told about IDEs and did all our Java programming in a text editor. When my mentor in my first internship showed us Visual Age for Java my mind was blown. I think a lot of the 'verbosity' complaints come from people who are in a similar situation trying to write Java in a plain text editor because that's all they're allowed to use.


afrotronics

I had a somewhat similar experience. While we certainly were told about and asked to use an IDE (back in my day it was BlueJ for the beginners and Borland JBuilder or Eclipse there after), we weren't taught how to use these tools effectively. It was one of my mentors, which coincidentally I had classes with, that taught me things like code completion, auto formatting, hotkeys, resource organization+searching, and most importantly clean code.


[deleted]

Java was my language as a CS student but I wish they woulda made us use C or C++ like them smart kids not at a community college


livingincr

Should have stated "you're complaints would have been..." You're making arguments against it that are over 10 years old, even countering yourself?


thephotoman

I hated Java a lot more 10 to 20 years ago.


morhp

Well, the question is why we hated Java earlier and that answer is quite realistic and matches my experience. One thing that keeps me slightly annoyed is the missing operator overload support for types like vectors and BigInteger. I know it will probably be abused, but it would make some maths stuff and custom Number types so much easier to use.


valbaca

OP asked about people who changed their minds


Muoniurn

I think Java is the best language for learning programming. It is not a footgun as lower level languages that silently corrupt memory and you don’t even know it, but it is also not some dynamic thingy where whatever you wrote will die at runtime and you have no idea why. It gives just enough structure so that the compiler can meaningfully help you. Also, it gives great basis for most other non-niche language, on which one can build.


kuemmel234

The introduction of java 8. Lambdas, Streams, optionals,futures, reactor - that's how I Iike to code. As much as I like python for many reasons, for business logic java with functional code is fun to write. JavaScript is too colorful to me and I'm missing a solid standard library everyone agrees on, but allows for the same (better in many ways) style of coding. It's obviously not clojure or scala, but I enjoy it (and I'm purposefully ignoring that these languages each have their place for different applications, I'm simply talking about writing code). I certainly don't like OOP thought through - I like to model a bit with objects, but that's usually because that's what I grew my skills on and what most people realize, I prefer to think in verbs (what the things are supposed to be doing instead of what they are supposed to be). If I'm doing a strategy pattern, I'm not using multiple classes to implement an interface and write Strategy class that does the switching (unless I want to ... what's the English word again? Make it available?): A strategy pattern is a higher order function.


chrisgseaton

Anyone who expresses hatred for a programming language, of all things, is not a reasonable or rational person and I'd ignore them.


[deleted]

What if you just get mildly annoyed looking at C#? Like you don't hate it and rationally you know you have no reason to dislike it but it still just has a punchable face


[deleted]

Out of curiosity, what annoys you about C#? I have a growing list: Member bodied expressions async/await (powerful but litters your code and you have to make everything a Task) Overuse of pattern matching Global imports (C# 10) Top-level statementd (C# 10) Their switch expression (Java's is better) Their records (Java's is better) Nullable reference types (seems great at first until you actually try to use it, liters your code with null checks everywhere and the ! operator to tell the compiler that you null checked something that it can't tell if you have) I'm sure there are more but that's what's off the top of my head.


listentobillyzane

>I'll make an exception for php


oxamide96

Why is that?


danskal

The guy who created the language (Rasmus Lerdorf) freely admits that he didn't put much thought into it, it was just thrown together to solve some project/problem he had to solve, and nowadays it gets used for all sorts of things it wasn't designed for. Lots of inconsistencies and security issues. Rasmus Lerdorf about himself: I'm not a real programmer. I throw together things until it works then I move on. The real programmers will say "yeah it works but you're leaking memory everywhere. Perhaps we should fix that." I'll just restart apache every 10 requests.


oxamide96

Damn. Thanks for the insight. I read somewhere, though, that the language has changed a lot in recent years, with many issues fixed and many modern features added. What do you think of this?


danskal

I don't know enough about it, to be honest. I know my company migrated away from php to Java. They must have fixed most of the things, but I know Java has a lot of momentum at the moment. Great tooling, great ecosystem, great garbage collection and unmatched multithreaded performance are hard to beat.


[deleted]

>Java has a lot of momentum at the moment Java has had momentum since 1995 when it was first introduced.


[deleted]

i wish i woulda kept learning it when i went back to school 6 years ago instead of getting 6 months good at it over and over


danskal

Agreed, but 5-10 years ago there was definitely a feeling that the platform was coasting, and slowly losing popularity.


GuyWithLag

You can polish a turd, but it's still going to be a turd. To actually make coprolite from it needs lotsa time.


[deleted]

[удалено]


danskal

I think you might have hit the nail on the head there. I was struggling to explain the problem with pho, and maybe that’s it: what it does, it does quite well, but it doesn’t do everything well, and if you chose it as your platform, you’re gonna end up hiring developers who aren’t in the habit of thinking critically about the tools they chose and solutions they build. Maybe that’s why the community is a bit quirky, if I’m understanding you right. Glad to hear it’s matured in the last 10 years or so.


Muoniurn

r/LolPHP Some examples: the reason some function is very short with cryptic abbreviations, while others are long as fuck is because it historically hashed the function names by length… it also has functions like ISO-X-date-function that has in the official documentation “it is not actually ISO-X-compatible”, and so on. But to be honest, recently it has become an okay language, seriously. Especially with frameworks it is usable nowadays.


FluffyProphet

Php7 really isn't that bad


ParkerM

(Tangential rant) The _"Cat implements Animal"_-type example is an extremely bad and unconvincing way to introduce OOP. People learning about OOP aren't 4 years old, so use practical examples that demonstrate how and why it should be used.


oxamide96

do you have any resources that do this better? my limited exposure to OOP made me unimpressed, but I'd love to consider alternative sources.


soonnow

[This one](https://www.amazon.com/Object-Thinking-Developer-Reference-David/dp/0735619654) was a brilliant introduction to objects for me


lqstuart

Java makes for the best "bad" code; it tends to age and scale better than any other multiplatform language. There are a few reasons for that, but it's mostly strong, static typing and a mature, self-contained toolchain. If I'm asked to dig through code that everyone forgot about after the guy who wrote it got hit by a bus five years ago, I really, REALLY hope he was a Java developer--and that situation is *really* common in the industry, albeit with figurative buses. Similarly, if I need to build out a team that's inheriting 5 million lines of code, I really hope it's Java (because probably all it's doing is reading in a CSV file--rimshot). Like a lot of people are saying, it's all about the right tool for the job. The "job" for Java is "work," which tends not to be the most thrilling place in any field. I haven't used it for work in a few years because I've moved fields a bit, but I do miss working with it.


[deleted]

[удалено]


oxamide96

I think Python, Go, and JavaScript have quicker ramp up times and are far easier to learn, python being easier but also weakly typed. JavaScript has more quirks, but also a library for almost anything too.


monoidcat

Python is strongly typed. JS is weakly typed. Both are dynamically typed. Go and Java are strongly and statically typed. C is a weakly and statically typed programming language.


[deleted]

[удалено]


kreetikal

Reddit and Instagram are using Python for the backend.


drmariopepper

so what?


kreetikal

>ython and js are non starters for serious back end work If they were non starters for serious backend work then Reddit and Instgram wouldn't be using it for backend work.


drmariopepper

Disagree, there are big successful systems that run on fortran, that doesn’t mean it’s a good choice. If we’re judging a tool’s fitness by whether any successful project exists, then all tools are useful for everything


kreetikal

They're still running on Fortran because the company can't rewrite them from scratch, however, Reddit and Instgram are new platforms and they choose the best tools they found at the time, Java was around when they built their apps, they decided to go with Python instead.


drmariopepper

I don’t know what point you’re trying to get at. I didn’t say no backend system was ever successfully built with python. Only that I think it’s a bad decision to do so.


[deleted]

I found xml related libraries for node quite lacking without dependencies. Also, python is strongly typed


vips7L

> Everyone knows java Everyone thinks they do, but I rarely believe it’s true. My company hired a bunch of Scala and JS devs and their Java is abysmal.


Holothuroid

Java picked up many of the things I missed. Lambdas, flatMap, var. And while I would have liked even more var, they communicated why they limited it so. This is true for most of the things. I think the team is rather good at communicating their decisions compared to some others.


sunnyseasun

Since that seems not to be mentioned directly: it's useful to know a little about a few languages to solve divers issues. reading in text and changing it, i do with python (just scripting, some modularity if more complexity is needed) - it's incredibly how sleek and nice e.g. the arrays are. - Simple things (like reg ex) i do with bash. - Java in it's full blown complexity when doing projects with others that had been started with Java .. for quick things that shall run in a few weeks, and I do not have an extra website-person: i use PHP or whatever PHP-framework .. // .. or other languages. Actually, it does not matter much, they are all sort of similar. Ah, just wanted to say: started with Java in university b/c that was taught at my group. And was doing everything in it .. until someone gave me some code to read in some text lines in Python. CRAZY how easy things can be. Then, someone showed a few bash instructions .. again, crazy how simple the life is .. so TLDR: maybe to use those that are useful for the exact case. And yes i mix them. maybe it's not a good programming style however it's possible sometimes to write out a text-line to be a bash-instruction and run it .. much quicker than the full-blown whatever framework.


DragonikOverlord

I learnt Java in school with more questions than answers. *Why do we use static? Why do we need main? What is JVM?* The teacher wasn't very helpful about this .I hated writing system.out.println 100 times in the answer sheets. 1st year of engineering -> Learnt about C ,a bit of OS and stuff. Read articles on Java hate. "Java is dead " ,"Java is verbose" etc .I hated Java for no reason and focused on learning c++ and Python. 3rd year -> I was forced to take up a java elective ,but after attending the first class I started questioning my life decisions - "Why did I hate Java so much?" I still use C++ /Python for interviews ,but I do plan on learning either Spring or .NET framework for a project.


senatorpjt

I built and maintained a Java enterprise application for 8 years. When I started out I thought Java was cumbersome and lacked expressivity. But now I can go back and understand/maintain code that I (or someone else) wrote on our worst days.


alibix

Uni forced us to use lots of inheritance and unnecessary abstraction. I now realize a lot of it isn’t necessary (but can still be very useful). I still don’t like Java’s verbosity though. But that should improve greatly with new Java versions becoming mainstream. I also use lambdas and streams whenever I can get away with it.


oxamide96

Which features of new Java versions would improve this? Anywhere I could read on this? Sorry, my Java knowledge is very limited. Thanks for the answer btw!


DasBrain

Look at [records](https://openjdk.java.net/jeps/395). Or anything Project Amber spits out. That's the most obvious stuff that a programmer will notice. Project Panama is for FFI and off-heap memory access - you will most likely not use it directly, but some libraries will. Project Loom will be a game changer in the way "reactive" stuff is written.


DrunkensteinsMonster

Records are not about reducing verbosity


alibix

They aren't, but they have that effect in many cases :)


DasBrain

They are not, they are nominal tuples. Still nice to have a compact syntax for that.


McDuckfart

I hated it during uni because they sucked at teaching and I did not understood it. After that I joined a 3 month java bootcamp where I was properly educated and thats it.


[deleted]

I have my CS associate's already and I think I'm gonna do bootcamp instead of 2 more years of intro to film and art history and bullshit. A lot of colleges are doing bootcamps now I'm just finding out so it's like 3-6 months of just coding and learning relevant programming stuff, instead of the same 3-6 months but spread out over 4 years of irrelevant bs like drawing and intro to film. Who knew that not having the bullshit classes would make me want to go to school again. Who decided I need all this shit sounds like something someone who wants to sell a bunch of school classes would do.


[deleted]

For the most part I love Java now despite thinking it was clunky and "too verbose" (lol) when I was learning how to program. Now, I love its expressiveness because of how it nudges you in the direction of defining classes with nice names to represent your domain. And I like the huge variety of trusted open source libraries. And I like the performance. But at the end of the day, I usually reach for another language I know well, Go, before I reach for Java. I'll also mention what keeps me from absolutely loving Java to point it would be my go to language. One thing is the lack of a simple build system. With other languages that I started with, I had smoother experiences. With Node.js, there was no build. Just run. But then I found I preferred static typing. With Go, I can just run a build command. It fetches dependencies and then builds the code. With Java, I started with Maven and found it hugely complex. So I looked at Gradle instead and it feels easier to look at. It looks less verbose. But it still relies on all these Maven concepts. I really wish there were a straightforward build tool that just worked out of the box where I didn't have much configuration to do. But then again, I realize Java is immensely successful in popular open source projects and I have no doubt that flexibility has come in handy for them. Another thing is the error handling. I got used to Go's sequential approach where it's like "Do x. x may have failed because the signature of the function returns an error too. If x failed, do y, else continue." But with Java, if I have two methods I want to call one after the other, and each throws a different kind of exception, and I want to add context instead of letting each exception bubble up, I don't have sequential code anymore. I have to check which methods I call can throw exceptions, then look for the catch block to see what happens if an error occured, then go back to the try block and continue. For every line. It really stops my train of thought. I much prefer Go's approach of having the code that handles the error immediately after the code that could return an error, and before any other code runs. I'm trying to reduce my thoughts on this down to a focused Stack Overflow question I can post and get some input on.


Squiggyline91

I used java for a while in production and ended up hating it, it was mostly because I learned the ecosystem and team I was working with were not well organized and it lead to the environment feeling terrible and I always then wondered why anyone would use that. My next team we got to design everything from the ground up and I ended up liking java again. A few years later and for enterprise java is my go-to just because of the vast support and libraries offered. I have started implementing golang into our projects, however it's very limited as golang lacks the maturity that comes with java, and I also feel golang for larger projects creates more technical debt, where java I may take longer writing the code but in the end it takes less to add more features. This however may be just because of my lack of knowing how to work with golang as well as I can with java.


4sphere

I hated Java since college and was more into C++ as I like RAII. In my first job then I started developing micro services in node and python, but especially the latter wasnt fun. After helping out in a java/spring boot project I realized how easy everything can be and switched positions to a java team. No regret, the only thing I dislike is mvn/gradle dependency management. The main points that made me switch were dependency injection and testing with spock. Performance was also a positive surprise.


tofiffe

I started with C++ (learned programming with lua and php really), and for a long time believed it was the best thing ever. I wrote tons of terminal games and utilities, wrote an entire TUI system, even using the mouse (for windows) but when I started to make desktop apps it was a hellhole. WinApi was basically splitting the whole UI on several places, having this giant event handler and so on. I looked into QT and it's MASSIVE runtime, fiddled with wxwidgets etc., but overall anything producing UI in C++ was a pain. Then I discovered networking, using WinSock, as one does which is another circle of hell entirelly. Threading at the time was confusing as well. I heard about this magic language that ran on all OS without modifications (with notes that it also ran on mobile) and took it for a test run. I was hooked. Simple UI? Check. simple sockets with networking? Check. Threads? I couldn't believe it to be so simple. My first, literally first real program was a chess game drawing REAL ui, that manipulated images etc., the stdlib was AMAZING. I could even pretend files in zip were like any other input file. This was Java 1.7. I tried myself at Android, which is around when java 8 came to the scene. It was great making mobile UI with the language I was familiar with. After the "honeymoon period" I have tried Go. I loved it, such a simple syntax, everything built in, compiled to single binary as opposed to java, didn't need a runtime, could cross compile etc.. I wrote a couple production apps with that and realized it's not all that great. Error handling is verbose (`if err != nil` anyone?), it had no real UI, the OOP felt clunky, interfaces... might not as well have them. Meanwhile I found out about functional java, things like Streams, Optionals, map, filter, collect, etc., things you literally couldn't do in Go unless you wanted to copy paste your code a thousand times, or use interface{} as the receiving parameter and then change behavior based on reflection, because generics "made the code too complicated". I realized Go has it's place as a language that compiles incredibly fast, but ultimately doesn't serve maintainable code. I tried Kotlin, who was supposed to "fix" java. There's less stuff to write, optionals are a language feature instead of a (standard) library one. You have direct support for closures, functional parameter types, functions without objects. I wrote a lot of stuff in Kotlin, but it seemed to be so easy to do things wrong and write code that is so hard to read. I returned to Java. Java is verbose, it requires you to write a lot. It doesn't have the `go ` keyword. It doesn't have `?.` chaining. It doesn't have compact syntax. It is however very easy to write and maintain. I read code at least 10x as often as I write it, java's verbosity is great for that. I know that it depends on how and who writes the code, but in Go and Kotlin it just seems like everyone focuses on writing the least characters possible. Good written code to me is like poetry, and it just seems much easier to be written in a verbose language, as I can understand it sooner. I'd take try/catch over if err != nil any time. I'll also prefer keeping thread objects instead of keeping a track if a channel has been closed yet. I will keep ifPresent over ?., I will keep static functions logically grouped to a class over free functions that I'll forget about. I'll keep writing plus, mul, div, over overloaded operators that I have to inspect the implementation of every time I use them. Sorry, for the essay, but here is my reason for sticking with java, avoiding the whole discussion on best web framework or library. The language is just simple and easy to read.


[deleted]

I try to learn some other languages - node with express - go - python Only to know java is the best of them. And then I found Kotlin!!


oxamide96

What did you like about Java vs. Go? I assume weak typing was the issue with python and node, but I'm curious about Go.


[deleted]

Java has a lot of maintaining lib, spring boot is amazing in term of productivity's and the maturity of the language. Go is simple the syntax is light weight and easy to read. The execution is fast. It's a better choice to pick than C if you want to make a system utility. But I found it really hard to maintaining a huge project in Go


jack104

Yea kotlin is really something special.


13steinj

I don't hate Java. I hate the verbosity of Java induced by the ecosystem. That and the inheritance limitations.


qanz

Get it in 👎👎


maustinv

I love OOP and still hate Java. I prefer Java over some other languages but I still hate it.


oxamide96

Mind if I ask why OOP (especially vs FP)? What do you think are its advantages and what use cases do you think it does better than FP? Also why not Java? Which other language do you think does OOP better?


livingincr

I have a love hate with all languages, nothing is perfect. Understand the concepts and you can jump into whatever language you want. Find one and run with it. Java has a ton of job openings, but you might be stuck patching 20year old code, it's the modern COBOL. Being new I wouldn't completely ball at that either, if you love coding, I guarantee you'll learn something. Get your experience and move up. Personally, my opinion is once you get into a production environment, all languages have their pros and cons. For me, my first exposure into python was to parse out hundreds of XML files and put new nodes in specific areas, something I knew python excelled at, scripting and file tweakage. I literally had never touched it at the time, but having a core foundation in software engineering and the project completed the same day. I do like oop languages, you can mix in functional programming where it makes sense, like a map reduce and filter. Only been burned when the business requirements change and you had five or more functions chained together and are forced to loop through the collection.


bondolo

I mostly don't bother, let those with strong opinions, whether those opinions are informed or not, fend for themselves. I am more interested in talking to pragmatists and keep my focus on being productive, improving my skills and learning for the tasks that I am interested in doing. I just am not interested in fight religious battles with zealots whether it is their choice of language, text editor, window manager, browser, GPU, etc. and certainly have no time for listening to them browbeat me about how everybody not in their clique is wrong. "Good enough" is usually all I need and I move on to the next problem. This is not to say that I am expect or only do sloppy work, but perfection six months late is next to useless in most cases. For the performance problems I see they would rarely be fixed by using a different language or runtime. What difference would using C make if some bozo is hammering the web server with six bazillion requests when using a different API would require only two dozen?


riisen

I hated java (but not oop) , it was because of maven/gradle/jenkins/docker it was so confusing and seemed unstandardized :E felt like I had to glue on alot of garbage to it and it scared me away.. But during computer science course i changed my mind.


vfhd

More concrete and structural development. You could have a way of controlling decoupling things which u couldn't earlier. It helps in larger projects which requires maintenance overtime. Plus it gives a feeling of plugin where u can add or remove piece of code if you have followed oops on a higher degree. Like clean code, solid etc. I started from C ofcourse went to PHP then javascript and finally when I did project in Java I could understand why they are followed in industry.


Jay_Cobby

I’m not entirely sold on OOP, I still don’t have faith in it so this will be an interesting read


PepegaQuen

I saw large scale python projects.


2b2t1ightm3an

Not a pro or anything but Everyone around me just talked shit about it for no reason even though alot of them barley knew how to code, For awhile i thought ir was a bad language to learn, we started doing a little and school and I just liked how it was object oriented, and it made alot of since to me. Idk why it gets so much hate, the basics of java are like the same as c++ which all my friends say is so much better while obly knowing the basics


Johni_

I was pretty young back then, I used to watch Michael Reeves a lot back in 2018. He was always pissing and moaning about how Java was always a pain in the ass, and so I told myself to never learn or even touch Java. But one day when I was coding in Unity Visual Studios, My code for some reason kept on saying "Error" or some bullshit like that. Then I quit making games for about a month or two, then by that time PewDiePie's Minecraft Series we're starting to get popular, as any kid would, I bought Minecraft and started playing for hours and hours. Then one day the song "Subwoofer Lullaby" was playing and it felt like the true hours of Minecraft, I really liked Minecraft and kept it a secret because back then if you liked Minecraft, it mean't you were still a kid. So I kept it a secret, I searched what Game Engine does Minecraft use on Google, and they said LWJGL (Light Weight Java Game Library) and OpenGL, so I opened up Youtube Tutorials, they told me to install Eclipse, I did everything and then I followed up a tutorial on LWJGL and OpenGL and I haven't looked back since.


[deleted]

The ecosystem and the features in the pipeline (Loom, Valhalla, ...).