News for hackers. Stuff that matters.
Re:Greatest Java apps by jmartrican on Monday June 29, 2020 @09:19AM (#23677284)
What are the odds that a language known for its use in boring enterprise software is the language used to create the most popular video game in history (Minecraft). If C++ was a person it would be mad/salty at this fact.
Re:Greatest Java apps by Waterluvian on Monday June 29, 2020 @10:03AM (#23677696)
It's a great reminder that the customer doesn't care about the code. What matters is the experience and overall fidelity of the product shipped.

The language you pick, the quality of code you write, the comments and documentation, are all products (gifts) targeting your future self, future peers, and employer when it comes time to make changes to the software.

Re:Greatest Java apps by nonbirithm on Monday June 29, 2020 @10:47AM (#23678058)
> the customer doesn't care about the code

I'm not sure this applies as strongly in Minecraft's case specifically, because of the critical importance of its modding community to its wild success. Normally it wouldn't matter what language you pick in terms of how popular the game is going to become, except it just so happened that by choosing the JVM they gave the ability to the community to decompile the game and add the content they want. Maybe this wasn't intended and Notch chose Java because it was what he happened to know, but it's my belief that if Minecraft had been written in C++ instead then Mojang would not have the brand recognition it does today. Anecdotally one of my friends tried the RTX version of the game which was rewritten in C++, and his reaction amounted to "it's fine, but there's no mods, so it's irrelevant." And that's in spite of the fact that modded Minecraft is a minefield of incompatibilities between years old versions and can easily consume 10 gigabytes of RAM and millions of extraneous CPU cycles. Nobody cares, because at the end of the day modded Minecraft is the only way they can get the specific experience they want out of a video game, and the only reason this is possible at all, even if it will never be performant, is the JVM.

But that's only because Minecraft is one of the most popular video games in history, and not the kind of thing that a developers for a game nowhere near as successful would worry about before gaining a sizeable audience. What good is a modding system if not many people want to use it? And depending on the game a mod system might not be as warranted, so in those cases the choice of language doesn't matter as much.

Re:Greatest Java apps by nineteen999 on Monday June 29, 2020 @06:47PM (#23684336)
> it just so happened that by choosing the JVM they gave the ability to the community to decompile the game and add the content they want

That wasn't their intention; Minecraft code was originally obfuscated specifically in order to combat reverse engineering and modification.

https://www.reddit.com/r/Minecraft/comments/mpslv/why_are_mi...

https://minecraft.gamepedia.com/Obfuscation_map

Re:Greatest Java apps by nonbirithm on Monday June 29, 2020 @08:38PM (#23685242)
True, but I find it amusing that none of that even mattered and the community was persistent enough to build an entire architecture, database and IRC bot solely for deobfuscating the source of Minecraft anyways. So long as nobody would get sued for it, it was still possible from a technical standpoint, so the motivated people did it anyways.

And now it seems that Twitch and other "official" entities have conceded to the fact that modding was really the only reason so many people play Minecraft at all and they integrated installing mods into their official launcher. Server hosting for Minecraft is a legitimate business since you'd need enough RAM and single-core performance for mods also, so they advertise "mod-capable" hosting plans.

On top of that the entire decompiled and deobfuscated source of Minecraft 1.22 is sitting on GitHub to search through.

The sheer extent of modding capability that Java enabled caused this weird conflict between the interests of the parties wanting to retain the intellectual property of the game through obfuscation while at the same time admitting that people undoing it and using the source themselves for modding is never going to go away, and trying to forcefully get rid of it for the sake of this legitimacy anyways brings no benefit and would only anger and drive away the audience who already comes to expect mods. And then some group would probably just hack together some unsanctioned server/client package from the JARs that are already widespread and keep playing the old versions forever, since they'd still want to play modded Minecraft anyways, and there's no reason the whims of a few corporations ought to invalidate the past several years of modded Minecraft experience they've lived through already. At least it's a better case for modding than purely competitive games since a lot of Minecraft is about construction.

Sometimes I think that the only games that will truly last for the ages where new things are still being created and discovered regularly are the ones whose source code is in the control of the players, and they aren't actively poached for "stealing" in an attempt to extract a few more dollars per person. That, and the playerbase being motivated enough to keep developing content for them. It seems Minecraft is one of those few games as of present.

Re:Greatest Java apps by bobthepanda on Monday June 29, 2020 @10:51PM (#23685993)
> That, and the playerbase being motivated enough to keep developing content for them.

This by far is the most important thing. You could have a beautiful open source game but if no one knows about it or wants to play it, it's less than useful.

Some of the biggest modding communities I am aware of came from closed-source games; the Sims has always had strong, years-long modding lifetimes, and SimCity 4 and Cities Skylines after it had total overhaul mods that changed entire game systems, as well as thriving communities of less ambitious mods.

Re:Greatest Java apps by haecceity on Monday June 29, 2020 @06:34PM (#23684191)
C++ minecraft should have an SDK for mods
Re:Greatest Java apps by pjmlp on Monday June 29, 2020 @10:18AM (#23677816)
The proven example that instead of spending endless hours discussing what languages are good for creating games, one should focus in creating them in first place.

Incidentally C++ also had to fight against Assembly, C and Pascal for adoption among game developers, and the Playstation SDK was one of the contributors to change this.

Re:Greatest Java apps by nyc640 on Monday June 29, 2020 @12:26PM (#23679060)
> most popular video game in history

* citation needed

The most popular game by player count is CrossFire [1]. All I see is that Minecraft has the highest unit sales for a video game across all platforms, but Minecraft for consoles and mobile (which make up a majority of sales [2]) are written in C++.

I would argue that Java would have been a limiting factor for Minecraft reaching its current levels of success given the fact that the PC gaming market is relatively small compared to the console and mobile gaming markets, and it would've been nearly impossible to port the Java edition to so many different platforms.

[1] https://en.wikipedia.org/wiki/List_of_most-played_video_game...

[2] https://minecraft.gamepedia.com/Bedrock_Edition#Sales

Re:Greatest Java apps by pjmlp on Monday June 29, 2020 @01:12PM (#23679571)
And to this day people keep complaining about the modding capabilities of Bedrock.
Re:Greatest Java apps by mumblemumble on Monday June 29, 2020 @10:34AM (#23677944)
I'm pretty sure the most popular video game in history was implemented in TTL.

(Though Java versions certainly exist, too.)

It's also worth noting that Minecraft was originally implemented in Java, but, in order to get it running on consoles and mobile, they had to port it to C++. Which doesn't discount how much Java contributed to its early success. (Most importantly, I'm guessing, by making it even feasible in the first place for a single person to implement it in so little time.) But still, the big picture version of the Minecraft story does more to support than challenge the main reason why C++ is considered the language of choice for games development. Because, yes, Java got it off the ground, but it was only a couple years later that they had to port it to C++ in order to access a mass market.

Re:Greatest Java apps by andonisus on Monday June 29, 2020 @10:37AM (#23677969)
The Java version is still very popular due to its support for mods.
Re:Greatest Java apps by mumblemumble on Monday June 29, 2020 @11:49AM (#23678656)
It absolutely is, and it's my preferred version. But I think I remember seeing somewhere that the vast majority of unit sales were of versions that were written in C++. My guess is that, if it had stayed Java only, it would have still been extremely popular, especially by indie game standards, but would not have become quite such a global phenomenon.
Re:Greatest Java apps by itronitron on Monday June 29, 2020 @04:25PM (#23682376)
The C++ versions may drive new sales on additional consoles but measured by hours played I would expect that the Java version of Minecraft still dominates.
Re:Greatest Java apps by fulafel on Monday June 29, 2020 @04:05PM (#23682034)
What's the game implemented in TTL?
Re:Greatest Java apps by mumblemumble on Monday June 29, 2020 @06:14PM (#23683947)
Pong
Re:Greatest Java apps by fulafel on Tuesday June 30, 2020 @06:13AM (#23688539)
I guess as a % of market share it was pretty popular :)
Re:Greatest Java apps by blackrock on Monday June 29, 2020 @04:58PM (#23682961)
What graphical library did he use to implement Minecraft? Or did he roll his own?
Re:Greatest Java apps by ertucetin on Monday June 29, 2020 @05:42PM (#23683523)
He used lwjgl library
Re:Greatest Java apps by geodel on Monday June 29, 2020 @10:25AM (#23677872)
Well that assumes lot of boring enterprise software is not written in C++.
Re:Greatest Java apps by suyash on Monday June 29, 2020 @03:57PM (#23681924)
TensorFlow is written on top of C++, how boring is that, I think it's one of the coolest tech.
Re:Greatest Java apps by guardian5x on Monday June 29, 2020 @09:46AM (#23677524)
Yea probably, I doubt that Minecraft would've been any less succesful written in C++ or any other language though.
Re:Greatest Java apps by akavi on Monday June 29, 2020 @09:49AM (#23677547)
I've heard that the relative ease of decompiling Java might have contributed significantly, since it made mods much easier than they would've been with C/C++.
Re:Greatest Java apps by hoseja on Monday June 29, 2020 @10:03AM (#23677699)
Yeah, the game is almost source-available, thus almost infinitely moddable. Games that provide neat modding APIs (thinking Factorio, Rimworld) are, while commendable, inherently limited. If Minecraft were C++ you'd have to be able to recompile it yourself for equivalent moddability.
Re:Greatest Java apps by 7786655 on Monday June 29, 2020 @05:57PM (#23683701)
Minecraft isn't source available, it's just that people in the community have put a ton of effort into decompiling and deobfuscating it. Granted, this probably wouldn't have been possible if it were written in C++.

(At least, this was how it was pre-Microsoft. I haven't followed it since then.)

Re:Greatest Java apps by blackrock on Monday June 29, 2020 @05:05PM (#23683051)
Could Minecraft have succeeded if it had a sub-level scripting language, like Lisp? The way that AutoCad uses it for its sub programming. Or the way Emacs uses Lisp for macro programming.

Or did it need the full Java source code to re-mod the program?

Re:Greatest Java apps by smabie on Monday June 29, 2020 @09:50PM (#23685668)
AutoCad and Emacs aren't really comparable in their use of Lisp. Emacs is essentially an Elisp interpreter with some features for buffer management, while AutoCad just uses Lisp as a traditional scripting toolkit. Emacs is built with Elisp, AutoCad is not.
Re:Greatest Java apps by lispm on Tuesday June 30, 2020 @05:37AM (#23688317)
The C code in GNU Emacs does a bit more than implementing a 'Lisp interpreter'.

https://github.com/emacs-mirror/emacs/tree/master/src

Quite a bit of the actual GNU Emacs application is using libraries written in C. See for example the font code.

https://github.com/emacs-mirror/emacs/blob/master/src/font.c

This is different from some other Lisp systems, where only the base language runtime contains some C and/or assembler, and the actual application is mostly written in Lisp using an FFI (foreign function interface) for library calls. For example the GUI of Clozure CL is written in Lisp using an Objective C bridge, and not directly in Objective C and then called from Lisp.

Thus Emacs Lisp is also somewhere in a continuum of implementation and extension language - using C not only for the Emacs Lisp language runtime, but also for basic application implementation...

Re:Greatest Java apps by Eldt on Monday June 29, 2020 @09:53AM (#23677594)
I'm confident the community driven modding contributed to Minecraft's success in a massive way.
Re:Greatest Java apps by the_af on Monday June 29, 2020 @10:02AM (#23677688)
Depends. Success measured how? For the end user -- the players, that is -- it would likely make little difference. For the developer, it's very different. A game that doesn't get made at all is infinitely less successful than one that exists.
Re:Greatest Java apps by nineteen999 on Monday June 29, 2020 @06:48PM (#23684355)
> If C++ was a person it would be mad/salty at this fact.

Are you serious? Wake us up when somebody implements something as complex and performant as UE4 in Java. Or even UE3 for that matter.

Re:Greatest Java apps by rH61W3epxeHMjg4 on Monday June 29, 2020 @10:19AM (#23677834)
The concurrently developed Minecraft Bedrock edition is written in c++. That is code base for Widnows 10 Edition, Pocket Edition, and current console versions of the game.
Re:Greatest Java apps by the_af on Monday June 29, 2020 @10:06AM (#23677718)
And yet people here on HN have told me in recent threads, when discussing Java, that:

- Java is not suitable for enterprise software (yes! Some people here actually believe that).

- Java is not a good general purpose language (but Minecraft was written in Java. Or even better, the list of very varied apps from this article shows it's indeed a good general purpose language).

What these people actually mean is "I don't like Java". Because Java hasn't been "hip" for years, this makes people claim all sorts of absurd things about it. Things that directly contradict known history.

Re:Greatest Java apps by mumblemumble on Monday June 29, 2020 @11:58AM (#23678769)
I work in Java every day, and I agree it's been a huge success. But I also don't think it's a good general purpose language. It's absolutely full of warts and gotchas and ergonomic problems and questionable design decisions that even the people who made them have come to regret.

But known history tells us that there is very little correlation between a language's success and how well-designed it is. Outside of software, too - I think the archetype for this phenomenon is probably VHS and Betamax.

Re:Greatest Java apps by the_af on Monday June 29, 2020 @12:05PM (#23678836)
> It's absolutely full of warts and gotchas and ergonomic problems and questionable design decisions that even the people who made them have come to regret.

And which general purpose language isn't?

Re:Greatest Java apps by apta on Monday June 29, 2020 @12:05PM (#23678841)
> questionable design decisions that even the people who made them have come to regret.

Such as?

Re:Greatest Java apps by gschrader on Monday June 29, 2020 @04:50PM (#23682820)
Re:Greatest Java apps by mumblemumble on Monday June 29, 2020 @06:12PM (#23683928)
I think the most interesting one to me was an interview with Joshua Bloch in the book Coders at Work. It was to do with generics, of course, but distinct from the usual surface-level debate over type erasure. He felt that generics were rushed, and that they could have done a better job of sorting out the details of how things were going to work at the language level if they had given themselves more time.
Re:Greatest Java apps by apta on Tuesday June 30, 2020 @01:01PM (#23692165)
This is a good read[1], and they're "fixing" them with specialization.

[1] https://cr.openjdk.java.net/~briangoetz/valhalla/erasure.htm...

Re:Greatest Java apps by chopin on Monday June 29, 2020 @05:40PM (#23683498)
Wild mixes of consumer and provider API's for example in Swing. The later designs have been much better in that regard.

The built-in http client library is borderline horrible.

Re:Greatest Java apps by csharptwdec19 on Monday June 29, 2020 @03:34PM (#23681590)
As someone who's not a big fan of Java, I don't get those arguments.

If anything my argument for Java would be that it tries to be good at -everything-, and because that attempt started from day one (versus, say, C# starting primarily on desktop, then Web, and worrying about smaller targets and big servers later).

And I think it's pretty good at all of that from a 'capability' standpoint.

But because it tries to be all things for all people, it's pretty easy to wind up down rabbit holes of large frameworks. And that leads to the warts Java has from a usability standpoint.

Re:Greatest Java apps by jrsj on Monday June 29, 2020 @06:41PM (#23684263)
I would say its suitable, but I wouldn't say it's a good general purpose language for a variety of reasons. The first being that "good" is totally subjective. It feels like it has lagged behind its competitors both in terms of language features and API design. Its generally crappy for GUI apps. It doesn't really excel at anything in particular unless you're already invested in it. Even it's original premise of "write once run anywhere" is mostly irrelevant now, and there doesnt seem to be a future for client side Java apps outside of Android.

Overall I'd prefer to use just about anything else in pretty much any domain where Java would be a consideration. It may not be an inherent problem with the language itself, but its ecosystem in my experience leaves it as one of the worst general purpose languages in terms of productivity while not offering a sufficient advantage to make up for that.

All that being said, Java is still good enough most of the time.

Re:Greatest Java apps by the_af on Saturday July 04, 2020 @11:53AM (#23733089)
My experience with the ecosystem is the opposite. The ecosystem is so good, and so mature, it's hard to argue for other technologies at my current job.

For any fancy new language/framework, you must show you understand its performance issues, pitfalls, metrics and monitoring tools, etc. Few languages beat Java at this for serious work.

Re:Greatest Java apps by bzb3 on Monday June 29, 2020 @12:00PM (#23678782)
The performance of the Java version of Minecraft is so terrible that the entire game had to be rewritten to be played on consoles.

Minecraft was not popular because of Java, Minecraft was popular despite Java.

Re:Greatest Java apps by wing-_-nuts on Monday June 29, 2020 @12:05PM (#23678848)
I strongly disagree. A big part of minecraft's popularity is due to it's mods scene, and it's mod scene is so successful because modders could decompile minecraft's classes and build a deep understanding of how minecraft works under the hood.
Re:Greatest Java apps by pjmlp on Monday June 29, 2020 @01:11PM (#23679546)
The game had to be rewritten because Microsoft is a C++ shop and game consoles SDKs don't support Java, and it was definitely easier to port the game to C++ than to create Java AOT compilers for game consoles.
Re:Greatest Java apps by the_af on Monday June 29, 2020 @12:07PM (#23678860)
That's highly debatable, not a point of fact.

And the rest of the apps from the article? Are they also successful "despite Java"? At which point are you willing to admit that maybe Java was suitable for general purpose programming? Which amount of evidence would convince you?

Re:Greatest Java apps by bzb3 on Monday June 29, 2020 @12:11PM (#23678906)
What's debatable, that the Java version of Minecraft had terrible performance or that the console ports are not written in Java?

About your other question: I only mentioned Minecraft.

Re:Greatest Java apps by recursive on Monday June 29, 2020 @10:55PM (#23686017)
The point that's debatable is the point you led with, that Minecraft "had" to be re-written because of poor performance.

Not that it was.

Re:Greatest Java apps by akhilcacharya on Monday June 29, 2020 @10:09AM (#23677739)
Of course, all of the new advancements have come in the Microsoft-built C++ version that runs an order of magnitude better (including like ray tracing and VR)
Re:Greatest Java apps by pjmlp on Monday June 29, 2020 @10:22AM (#23677850)
Although C++ allows for better code optimizations, it isn't as if the team that took over later Java versions was doing anything great.

Using classes to represent points and vertices instead of arrays, and allocating in hot paths, really?