r/java • u/pimterry • Aug 09 '22
Don’t call it a comeback: Why Java is still champ
https://github.com/readme/featured/java-programming-language17
u/kkjk00 Aug 10 '22
The guys at news.ycombinator have quite a bad opinion on Java, they favor GO, although I worked with both and can't stand go, the amount of for loops and if err != nil, is staggering and obscure the logic, not to say the stress that somewhere you missed a "return err" which will crash the whole process.
9
Aug 10 '22
Java can do everything Go can do and more, faster, and with better language constructs but at the expense of ram.
14
u/dpash Aug 10 '22
Go's error handling is the thing that makes me not want to go near it. They have or are fixing the lack of genetics.
Rust's error handling seems much better thought out and far less verbose.
14
u/lechatsportif Aug 10 '22
Ignore the hacker news anti-java people. They're stuck in some weird echo chamber where their biggest complaint is typing out dtos or some fictional enterprise java company. They all claim to have used java for years and years - honestly they seem like fakes to me. Go seems like a disaster once you start getting into the fine print. Rust looks more compelling.
1
u/ReasonableClick5403 Aug 15 '22
This, it was especially prevalent a couple of years ago. I've worked extensively with Java and quite a bit with Go, and I am really hesitant to work full time in Go only. Go is ok, but writing quality services is such a boring chore in Go, with the severely lacking error handling. I still use Go every now and then for certain types of network services and internal tools.
0
Aug 10 '22
[deleted]
2
u/ReasonableClick5403 Aug 15 '22
What go tooling is so awesome? I have to say I only find it ok, and the modules situation is an absolute nightmare. pprof is alright I guess?
I used to really enjoy Go in the beginning, but I've had such a hard time trying to control the error values returned I've kinda soured on the entire language. errors became better when the Go team added a way to wrap errors in the stdlib so you get stacktraces, but unfortunately they cant change how any of the existing stdlib errors returned work until a go v2. The Go ecosystem is also flooded with medium and low quality libraries that are often dead, though there are some gems there too. I'd just rather use Java as my daily driver at work because there is always a great library available.
They did set a new standard for fast build times, tiny executables, and fast startup, so that was great. Yes, I'm looking at you too Rust.
1
Aug 11 '22
The limited library issue is something I've run as well; I suppose I expected more from a popular, 10+ year old language.
2
u/FriendlyRoyBatty Aug 15 '22
If there are no libraries, it makes it hard for me to understand how it can be "popular". Libraries are created/flock to popular languages.
This is the main reason why i have a hard time choosing anything but Java server-side. There are so many mature and battle-tested libraries that i don't find nearly as much in other languages, stuff that i've grown accustomed to taking for granted after maaaany years in the java world.
5
u/Joram2 Aug 10 '22
I prefer Golang's error handling to Java's exceptions. I like both Go + Java. Go's biggest killer features was goroutines, which Java 19 is matching with Virtual Threads, but also one-upping with the awesome Structured Concurrency API.
Go still has a simpler language, faster build times, tiny executables, fast startup, and has less old baggage than Java. And Go finally got generics. Java has some amazing ecosystems, it has a bright future with Project Loom+Valhalla.
1
1
u/Muoniurn Aug 10 '22
I don’t know, there was a quite fruitful discussion on the topic with only a few flamewar-y comments, buried deep.
24
u/agentoutlier Aug 09 '22 edited Aug 10 '22
Man some of githubs company urls confuse me into thinking it is some repository. There are like a dozen others I have seen like this where for a brief second I think it is a project. For example github.com/blog I would be pretty confident about that it is github's own official content but github.com/readme ....
I'm trying to remember the other ones like this to show what I mean. They should like use another domain name like github.dev or something.
——
Finally read it. Nothing new really.
Top menu bar was a PITA.
Also they could have at least had Java in the stock photo: https://images.ctfassets.net/s5uo95nf6njh/43Zb4Y1xxBtTP4b0LvebvZ/5e6ba62d8cd7556ca66279db1fa40784/iStock-1202250586.jpg?w=960&fm=webp
That language on the left I can’t figure out. C# ?
Java doesn’t allow imports with slashes.
13
u/benjtay Aug 09 '22
Is github the new livejournal?
8
u/agentoutlier Aug 09 '22
I don't know but that damn floating menu bar on the top of the screen is super annoying. At least half of those blogging/content platforms now put the menu as a sidebar (like I still don't like that but that is less bad).
I had to use the browser developer mode to delete the
div.1
1
u/coverslide Aug 10 '22
PHP
2
u/dpash Aug 10 '22
Yep, I was going to say that's definitely PHP. Backslashes in namespaces and traits while looking vaguely Java-like.
6
u/AesculusPavia Aug 10 '22
I’ve worked at two FAANGs, both times I’ve helped convert the codebases from Java to Kotlin. A lot of top tech companies have similar initiatives. Java isnt dead, but Kotlin isn’t Scala either.
(I know the article talks about interop helping java and Kotlin live together, but a lot of these company initiatives are to fully migrate to Kotlin unless difficult to do so)
6
u/DJDavio Aug 11 '22
Going from Java to Kotlin feels like going from a 7 to an 8.5 (on a scale of 1 to 10).
Java, especially version 11+, doesn't feel like the punishment it once did, especially with things like Lombok, Mapstruct etc. But Kotlin is just Java++, there isn't one killer feature which makes it 10x better than Java, but rather a lot of features each adding to a better developer experience.
6
2
Aug 12 '22
Companies like Amazon, Google, Netflix, Pinterest, Spotify, Square, and Zoom all employ Java across their vast codebases.
But big companies use all sorts of programming languages so that is not a good metric.
I think one big selling point for Java is that it is fast but nowhere near as difficult to use as is C and C++. And there are things such as GraalVM which is kind of cool - I can run my commandline java applications as statically compiled native binaries, at the least on linux (it all does not work 100% well right now on windows and I am sad that I can not easily just write small GUIs in Swing via GraalVM on windows, but hopefully the GraalVM team can improve all these issues).
Java is a bit similar to Go in some ways, IMO - kind of you wanted a simpler language that is not too difficult to learn compared to C and C++. It may not be as fast as C and C++ but in many cases that is not a compelling difference.
PS: Something is wrong with the text inputfield here; on other reddit sites the text input field appears normal. This one here seems to be cut at 50% in width ...
60
u/reikiman Aug 10 '22
I can comment on the period in 2009 when Java 7 was late to the game. I worked in the Java SE team from 1998 to January 2009 (there was a large layoff at Sun, and I was one of those who were let go, as Sun prepared to sell itself to Oracle). I also worked closely with Dalibor Topic, who is mentioned in the article.
Basically -- what happened to Java 7 is Java FX and some crazy-ass plans held by some product managers who thought Java FX could become a rival to the iPhone.
Over the course of a year or two, more and more people were piled into a project where the goal was to clone the ideas of the iPhone, but using Java FX as the front-end programming language, and a JavaSE-compatible mobile Linux+Java platform. In other words, roughly similar to Android, but focusing on JavaFX as the programming language.
The project became one of those classic - throw bodies at the problem of fixing the project. A complicating factor was to be pretending to use agile project management practices when the team seemed to not be using them correctly, in a software organization that had rigidly used waterfall project management for years. I was made a Scrum Master of a subproject without knowing a thing about Scrum or Agile or anything of the sort. I distinctly remember being on a large conference call that was a weekly status meeting, shaking my head over what a train wreck, then after the meeting heading down to the break room for some coffee, and passing the office of someone else who'd been on the call, who said to me "what a train wreck".
This project sucked in more and more people and the rest of the Java SE project suffered as a result.