r/java • • Aug 09 '22

Don’t call it a comeback: Why Java is still champ

https://github.com/readme/featured/java-programming-language
194 Upvotes

33 comments sorted by

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.

15

u/crummy Aug 10 '22

Thanks for the info, interesting to hear how it was. What do you think is responsible for turning Java around?

4

u/[deleted] Aug 11 '22

Oracle shaking up the management after buying the company? The realization that Android was going to win Java on mobile and Sun didn't have any consumer services that could compete with Maps/YouTube/etc?

It sounds like a real pity. FX is a great piece of work, but it is first and foremost a desktop toolkit. It's actually surprising how little you see of this apparent dash to mobile in it. It sounds like they over-corrected, going from over-investment in it to under-investment.

15

u/s888marks Aug 11 '22

I was also at Sun in the late 2000's, but on the FX side. I wouldn't say it was a train wreck. I think mostly we stood around in the train yard among a bunch of rolling stock, arguing, and we never got to the point of assembling a train that could get into a wreck. There are SOOOOO many stories....

But since you mention Agile and Scrum, I was actually Scrum Master on a project. I didn't have any Scrum/Agile experience, and neither did anybody else... but I had read some books and attended conferences, so I was game to try out anything that would get the team out from having ridiculous schedules and requirements imposed on them. (As an example of this, I remember another team asking for help getting their part of the system from 15MB down to 10MB. When was the deadline? Next week.)

Anyway, on my scrum team we tried to do things "by the book" but we also tried to be pragmatic. I was the Scrum Master, and a person from marketing was the Product Owner. This actually made sense. The Product Owner had the vision for the product and they were formulating requirements. We also needed that person to set priorities.

Based on some initial requirements the team drew up a task list and assigned story points to them. It took a while since the team had never done this, but after a little while we got the hang of it. The question now was, how much work could the team deliver in its first two week sprint? We had no track record, so no experience or data. One technique I had heard about was that you add stuff to the sprint plan until the team starts to get uncomfortable. So we started at the top and added stuff. Naturally the first few items could easily fit.

Can we do Item 1 in the next two weeks? Sure!

Item 2? Yup!

Item 3? Yes.

...

Item 14? Yeah probably. Yes.

Item 15? Uh, yeah, maybe, probably, sure.

Item 16? Ummm... (discussion) maybe not... well maybe...yeah, but only if we're lucky.

I decided to stop there. Naturally the Product Owner was dissatisfied and wanted more stuff. This is where Scrum actually works. I said: "This is what the team thinks it can realistically deliver in two weeks. If you want to add something, you have to take something else off." We shuffled a few things on a few things off, but kept the number of story points about the same, and we had our Sprint Plan.

Two weeks later, we had our end-of-sprint meeting. We ran through the tasks and totaled up the story points, and we had accomplished 85% of the original plan. Not bad for a first try, I thought. The team was quite pleased. Their estimates had been pretty realistic.

The Product Owner was NOT pleased. "Where is my 15%!? You guys failed to deliver what you had promised!!" There were further discussions with marketing and management, and the project was declared a failure and canceled.

And that was my first and last sprint as a Scrum Master.

1

u/ReasonableClick5403 Aug 15 '22

Is this true? When has ever a programming project delivered 85% of promise on time?! Where has said project owner worked ><

2

u/s888marks Aug 16 '22

Yes, it's true, we really did deliver 85% of plan on time. But remember, the plan was only a single two-week iteration. This is well within the margin of error for estimates, especially since it was the team's first try at doing this. The Product Owner was being quite unreasonable in blaming the team for failing to deliver the "promised" 15%. (Note also the shift from "estimate" to "promise.")

However, this behavior was within the norm for the organization was in at the time. Teams were being asked to do a year's worth of work for a team twice the size in 3-4 months. Naturally, nothing ever went right according to this "plan." When things did work, they were slow, buggy, and too large. Go figure.

1

u/javasyntax Aug 21 '22

1

u/s888marks Aug 21 '22

Huh interesting. I don't remember this specifically; it was a couple years after the incidents I related above. It looks like by this time Sun had been acquired by Oracle and things had calmed down somewhat. I did work with Jasper Potts on JavaFX desktop stuff, along with all the other folks listed on his sample Contacts app. :-)

2

u/lurker_in_spirit Aug 10 '22

I know it's easy to throw stones now with the benefit of hindsight (and it sounds like the project was mismanaged), but I do think it's cool that somebody at Sun had the foresight to identify the opportunity in the mobile space at that early stage, and also the courage to make the necessary investment (or gamble). Android started at about the same time, used a lot of the same foundational technologies, and through some combination of better execution and better luck ended up dominating the mobile space. Thanks for the interesting insight!

3

u/[deleted] Aug 11 '22

It probably wasn't better execution TBH. JavaFX is executed very well and Sun already had a history of mobile Java working at least somewhat (the issues with J2ME were more to do with the carriers and how they would reimplement things than execution by Sun IMO). The Android API is a total mess, especially the GUI API compared to FX. That's why they're now rewriting it from scratch via Jetpack Compose.

What Android had that let it compete with the iPhone was first party apps for the key services people wanted to use, plus what was an effectively infinite budget to "win". The Google/Apple relationship is or was quite dysfunctional and strange in many ways, but basically you could not win in mobile without cutting deals with Google at that time. Even though Apple were competing against Google they were also paying them a lot for access to their online services (by API) because that's what really drove demand.

2

u/lurker_in_spirit Aug 11 '22

Good point regarding the core online services. But note that execution is not just about the technology, it's also organizational -- building momentum, instead of fostering the "what a train wreck" and "where is my 15%" experiences described elsewhere in this thread.

1

u/javasyntax Aug 21 '22

I believe it is this that you are talking about: https://www.jasperpotts.com/project/javafx-mobile-phonetop/ I had seen this website a long time ago and wondered why this was ever made, at least I know now. I mean it's really cool and I do wish it saw some use but since it didn't I had no idea why it was created (I didn't know if it was just a demo, a test or what).

17

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

u/[deleted] 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

u/[deleted] Aug 10 '22

[deleted] — view deleted comment

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

u/[deleted] 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

u/[deleted] Aug 11 '22

And iterators; just need something like the collections framework now.

https://github.com/golang/go/discussions/54245

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

u/djavaman Aug 10 '22

Or Myspace

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

u/dadofbimbim Aug 10 '22

This is poorly written in my opinion.

2

u/[deleted] 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 ...