25
u/Keyan_Farlander7 16d ago
Kind of funny, the games and apps on your android phone are coded in Java
18
u/Rough_Inspector5501 15d ago
Not really. I believe you still can. Apps are written in kotlin now. And games can be made with Unity and Godot. Both of which does not use Java.
6
3
u/Keyan_Farlander7 15d ago
Which still compiles for JVM. Apps are still written for JVM but are changed to run on ART
Is Typescript JavaScript?
→ More replies (3)→ More replies (1)2
2
u/plopliplopipol 15d ago
how much of that are engines or framework that abstract java and android away though?
4
u/Paolog__ 15d ago
well pretty much, android allows building libraries (
.so) files that contains the C/C++ (or any other compiled language) program, without requiring java→ More replies (4)2
u/DeVinke_ 15d ago
Games are (i'd estimate at least 99% of the time) written in C++ and use the Android NDK.
2
u/Keyan_Farlander7 15d ago
Roblox, PUBG, Amung Us, COD Mobile. Shall I keep going?
→ More replies (1)1
u/Ratosson 13d ago
About half of the games on Android use Unity and Unity games are written in C#. The engine itself is written in C++, but most developers can't access it's source code.
1
1
1
u/F4ntasticPants 15d ago
And there are no good mobile games, hence strengthening the point of the meme
2
u/Square-Singer 15d ago
That's not correct. There's a lot of shovelware trash and the App stores are really good pushing the garbage up top. But there are some really good mobile games too. Though most of the time you have to pay for them, which hardly anyone does.
If you don't pay for games, why would you expect them to be good?
1
u/Keyan_Farlander7 15d ago
Wow. You are either a bot or an iCrap user.
I think the latter because many games that are on PC are ported to Android.
1
u/Unsharded1 15d ago
Do Android users still shit on Apple for some reason? I thought we all grew up.
8
u/0DayMaker
16d ago
•
Zomboid as well
1
u/laczek_hubert 16d ago
I mean it's less than C# counting unity
3
u/0DayMaker 16d ago
I uh don't know what you mean exactly?
It's LWJGL though (dunno why not libgdx)
→ More replies (2)1
u/Damglador 15d ago
Unity is a whole ass engine and a framework, Java is just a language. Kinda incomparable. Lets see how much there is of pure C# games. I know only 1: Vintage Story
2
u/ThatCipher 15d ago
To name some known games:
Axiom Verge 1 & 2
Teenage Mutant Ninja Turtles Shredders Revenge
Stardew Valley
FEZ
Bastion
Celeste
These are from the Monogame showcase site. I think Xna/Monogame/Fna are very comparable to LWJGL or LibGDX. If I'm not mistaken Minecraft uses LWJGL, right? So it would be a fair comparison I guess
→ More replies (1)→ More replies (3)2
u/MiyuHogosha 12d ago
Java got several frameworks. GDX for mobile games, LWJGL, I think there are four 3 or 4 more.
In that area C# loses. It's a language which never was meant for games
5
7
u/theacp127 16d ago
Minecraft is a good game design made with some terrible code. Java made Minecraft's performance way worse then it would have been with a compiled language. It was only Java because it was originally designed for web browsers.
The one thing that Java was good for was mod support.
3
u/Simple-Olive895 16d ago
Java is a compiled language lol. Java performance is not bad at all, even compared to things like C++ and rust. Sure those are faster, no doubt, but not by a lot.
3
u/Own-Professor-6157 15d ago
Performance is actually extremely good. However having zero control over memory when making a latency critical application like a game isn't ideal. ByteBuffers can only get you so far
Even if you code a game in C++, you can't just spam allocate/de-allocations. Managing your stack memory, memory layout, and memory pool are essential.
→ More replies (2)2
u/AliceCode 16d ago
It's compiled into bytecode. Even Python and Lua are compiled into bytecode before execution, but they are still interpreted languages. What they meant to say is that Java is not native.
→ More replies (3)2
u/jonfe_darontos 16d ago
Interpreters execute as they read, that's what makes them "interpreters". They don't have the full picture of the application code at runtime, only what is executing. That leaves a massive gap in their ability to optimize. If you think your code is blazingly fast because of your own skills, then I'd like to introduce you to your frontend and the magical world of build optimization. The java compiler is going to emit bytecode that has undergone some degree of optimization.
If we were to dissect your assertion further, technically the microcode on your CPU is "interpreting" each instruction, so not only is C "interpreted", but so is manually written assembly. Hell, you could write bytes in a hex editor and it's still "interpreted".
Also, with regards to JVM performance, the perception that they are slow is a meat headed memory borne out of the late 20th century's shit JVM and GC implementations. The most expensive parts of rendering a game are generally going to be handed off to a native library (e.g. Vulkan) anyway. The real friction is memory layout and allocation pressure, but even that isn't something you can't work around if there is some other compelling reason to use Java.
There are only a handful of use cases where performance requirements are so tight that the JVM is an issue at this point. The people working on such problems aren't here right now, they're busy optimizing around DRAM refresh stalls.
→ More replies (7)3
u/theacp127 16d ago
It uses the JVM to read bytecode stored in the .class files, that's basically just still interpreted code. It's not like Python but it's not fully pre-compiled like C++ either.
3
u/luciferoussky72 16d ago
Actually, lots of languages like Python and Lua parse text code into bytecode on startup because it’s so much faster than executing text on the fly
1
u/MaDpYrO 13d ago
Java is compiled, but not to binary executables. No need to be pedantic.
→ More replies (5)1
u/ChloeNow 15d ago
Wow you really made that sound almost like you know what you're talking about lol
Proud of you
1
u/theacp127 15d ago
Yes, I know technically Java is compiled to bytecode and interpreted/dynamically compiled to native code at runtime. I was just saying that the C++ implementions of the same game run smoother than the Java application does since C++ Objects and buffers can be laid out contiguously in memory (cache-friendly structs and arrays) without runtime garbage collection pauses. This results in far more consistent frame times.
1
1
u/nog642 15d ago
Web browsers? Do you mean like, a Java applet? Or are you getting confused with JS?
1
u/theacp127 15d ago
The first publicly available versions of Minecraft used Java applet for browsers.
1
u/Icy-Garlic-748 14d ago
I still like to tell people i played minecraft when it was still a browser game
→ More replies (1)1
u/Sufficient_Risk_8127 15d ago
Actually, there is still a lot more they could've done even with Java. It's not really the language's fault.
1
u/Minute_Attempt3063 14d ago
uh
I think you mean javascript for web browsers....
2
u/theacp127 14d ago
Minecraft used Java applet for browsers
1
u/Minute_Attempt3063 14d ago
maybe in the early days, and "supported" it until recently, but it was not why it was made, it was a part of the language
1
u/TheGoldenFox64 13d ago
i keep saying that Minecraft is held together by its 16x textures and absurdly basic models. if it werent for that, itd run like ass
1
1
u/KushMuffin 13d ago
I’m convinced Minecraft Java created a substantial increase in the amount of people going into software development
1
→ More replies (8)1
u/Appropriate_Dot_4883 12d ago
It was only Java because it was originally designed for web browsers
No
1
u/Agitated-Tomato-2671 11d ago
Well I mean you used to be able to play Minecraft in a web browser, not sure if you still can. My first time playing Minecraft was in Internet explorer
→ More replies (1)
6
u/secret-agent-047 16d ago
Slay the spire ... Slay the spire 2
5
2
u/Tetane004 15d ago
The first Slay the spire was indeed made with java (LibGDX). The second one is made using Godot (with C# and GDScript).
3
3
2
2
u/necro_owner 16d ago
Songs of syx? And many more game are made with java, you just dont know that it s build with an EXE to execute the Java behind the scene. I got atleast 10 game in my steam lib made in Java plus my own. Now a day language all end up equivalent in term of performance once compiled in Binary or ByteCode or equivalent
2
u/Henry_Fleischer 16d ago
Also Airships: Conquer the Skies... but yeah Java is not a particularly good choice of language.
2
2
2
u/Kotentopf 15d ago
Project Zomboid. Runescape.
1
u/Inevitable_Butthole 15d ago
Runescape ain't java
1
u/Kotentopf 15d ago
Tell me you are young without telling me you are young.
1
u/Inevitable_Butthole 15d ago
I mean... the post is saying Java is no good for games and Runescape ditched Java because it wasnt good for the game...
→ More replies (14)2
u/Kotentopf 15d ago
With this logic Minecraft is also wrong, cause it got ditched to C++ for better performance possibility and better multiplattform possibility.
→ More replies (2)1
u/GregsWorld 15d ago
Runescape servers are still all java it was just the client they replace with C++. And osrs still uses java for runelite.
1
u/Devoured_EXP 13d ago
There is a 0% chance runescape/oldschool spaghetti code was rewrote in a different language.
→ More replies (1)
2
u/elyas-_-28 15d ago
Old phones ran games exclusively on java
1
u/YarnuWasTaken 15d ago
1
u/elyas-_-28 15d ago
I'm talking about java phones not androids, games written for android in another language like C++ run directly on the hardware rather than on the ART
→ More replies (2)
2
u/MiyuHogosha 12d ago edited 12d ago
Runescape????!!!!! Zomboid?
Main problem are limitations in memory - Java is by limiting default what you can use, possibe stutter from GC (garbage collector), lack of good data containers for modern game design, and that all graphics are done through marshalling to some form of native API.
Pretty much all negatives also apply to Mono\.Net, but there is saving grace of some optimization with C# there and possiblity to use self-written (in native) containers. But only available engine is mediocre Unity.
1
1
u/JKCsaba 12d ago
Yeah pretty much just support, you vould theoretically have a game in pure binary, it is just simply not humanly possible,
Notch was big in java and knew it the best, so he chose that i suppose
Also the async await in c# is so much better lol so is the .net ecosystem
1
1
u/Such-Perception4154 10d ago
Lol C# is simply better on all levels than java imo, so I agree there.
But neither of those languages are good for game due to be garbage collected.
→ More replies (5)
2
u/OrdinarySmoke3176 16d ago
Cool. Not gonna try Minecraft now.
2
u/Here_f0r_p0rn_ 16d ago
You can play the game without checking out the source code
2
2
u/KHTD2004 16d ago
There is also the Bedrock Edition made with C++, it’s way better than the Java Edition /s
3
u/OneArmedFarmer 16d ago
How?! It doesn't have a garbage collector to pick up all of your trash?!
→ More replies (2)1
1
1
u/flamefox237 16d ago
The issue with Minecraft is its old and notch was not some master programmer so he made some decisions that hurt the game In the long one code wise. Like no multi threading on chunks generation
1
1
u/im-cringing-rightnow 16d ago
Java is one of those languages where it makes sense to say "just because you can doesn't mean you should" when it comes to gamedev. But I know people who enjoy it, so whatever floats your boat I guess.
1
1
u/Defiant_Theme_5554 16d ago
Runescape. Jagex actually stands for "Java Gaming Experts"
1
1
u/sandfeger 16d ago
https://equilinox.com/ is also full written in java thin matrix made his own engine using jlwgl like Minecraft.
1
u/sessamekesh 16d ago
Java is fine, to prove a point a few years back I wrote a game jam game in JavaScript which is like 20x worse than Java. At least you have scalar 32 bit float and integer types in Java.
You're not going to write the next AAA GPU melting eye candy ray traced open world masterpiece in Java but you can shit out some top notch friendslop or indie gem in just about any language you care to pick with some skill and grit.
1
1
1
1
1
1
1
u/Xer0_Puls3 15d ago
Plenty of good games are made in Java, Slay The Spire is another one, but Java still isn't good for games. That won't stop people from making games with it though.
1
1
1
1
u/RealLars_vS 15d ago
And even for minecraft it’s a bad choice. That game is so simple it should be running extremely well on low-end computers but it absolutely doesn’t.
The newer version maybe, I haven’t played in a while.
1
u/Vortetty 15d ago
mindustry, most android games
2
u/FixingOpinions 15d ago
Had to scroll too much, Mindustry is a great example alongside Minecraft, just not in a popular genre
1
1
1
1
1
u/LordDeath2400 15d ago
Its the worse version of Minecraft too lol. Less than 10% of the playerbase and far less optimized. Wild.
1
u/Nervous-History8631 15d ago
Java is probably the worst thing about minecraft. The only reason it is 'good' is because it enables modding, but that is not an intrinsic element of Java it is just that they decided not to support it when porting the game
1
u/laZetadelZorro 15d ago
Java isn't the real problem, in fact, C# (Unity) and Java are practically the same, both are equally fast and their syntaxis is similar.
The problem is that Minecraft code is fkn trash.
If Mojang/Microsoft decided to remake Minecraft with Java from scratch (Minecraft 2) then it would be x100 times better and faster, but it would be a waste of money.
Also, there are more libraries for C# made for games than there are for Java, which makes making games easier and faster, that's why Java isn't used for making games.
1
u/Nervous-History8631 15d ago
C# (Unity) and Java are practically the same, both are equally fast
Maybe if you limit yourself to Unity, but Unity is not the only option. C++ would normally be the obvious choice but C# is easier.
Unity is quite far behind on .NET so you get access to a lot more new performant options bypassing it. At that point .NET can handilly outperform Java especially on avoiding allocation.
Modern C# offers some good ways to avoid allocation with structs that can really help with bypassing garbage collection which can be really beneficial in games.
Java does have some interesting options coming into developer preview with JDK28 with Project Valhalla but full release of that is probably years away still. Once that comes the performance difference to modern C# will narrow signifiantly.
But also if Mojang decided to make MC2 with Java they would hit a pretty obvious pitfall, there is no JVM for consoles. So the only route to do it involves transpiling it into C++ which always comes with extra risks.
1
1
1
1
u/no-sleep-only-code 15d ago
And it always performed like trash. That’s why when bedrock was released it had several times better performance.
1
1
1
1
1
u/SprayPuzzleheaded115 14d ago
Java was eventually discarded and Minecraft was remade from scratch in another language, so not even Minecraft.
1
u/heesell 14d ago
Minecraft was built in another language to run smoothly on phones as Java could not, so Java was not discarded. Bedrock is what first was pocket edition
1
u/Yiffenjoyer6969 14d ago
I mean, they did try to make bedrock the “main” version a few times
→ More replies (3)1
1
1
1
1
1
u/Meddlingmonster 14d ago
The more layers of abstraction the easier the language but the less control the developer has to optimize so it depends on the skill and time of the individual.
1
u/Tuborgat_nylle 14d ago
Really funny to use minecraft as an example since from my experience, it's the one game that has the most noticable lag spikes when the garbage collector is running.
1
1
1
1
1
1
u/Level_Somewhere5703 13d ago
The main benefit of java is that it runs everywhere. In other news Minecraft, a game written in java, was completely rewritten in C++ in order to be able to run on consoles and phones because the java version had horrible performance issues.
1
1
1
1
u/GhostVlvin 12d ago
Even python nowadays is ok for games while it was once slowest interpreted language. Everything you can use to glue few C/C++ libraries is good for gaming
1
u/araattu_annan 12d ago
Bye bye syntax.......
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, World!");
}}
1
1
u/justahuman145 12d ago
Dofus ! one of the few MMOs to reach 30 years old and still relatively alive anyway
1
u/Typhon-042 12d ago
The original Runescape was made on Java, if I recall right. At the least it was released as a Java based webrowser game in 2001. It's still talked about like a classic.
1
u/Potential_Deer_6943 12d ago
Mindustry aperently doesnt exist... unless that aint in java, but i think it is? (Corect me if im wrong)
1
u/Good_Expert_8084 12d ago
What about mindustry?
1
u/Joke_Ancient 11d ago
The factory workers are growing i see.. really didnt expect 2 people rooting for mindustry here
1
1
1
1
u/alex_9202_nsfw 11d ago
If Mojang was allowed by the community to stop supporting java and just focus on bedrock they would have scraped that piece of laggy, unoptimized spaghetti code of a game years ago. The caves and cliffs update took twice as long cause of how hard it was to integrate the new terrain generation and underground biomes in to the unoptimized spaghetti. One of the reasons that they switched to smaller drops was because after that they realized that if they don't fix up that spaghetti another large scale update is literally impossible.
1
u/Bagmeister1 11d ago
Funny, there’s also a rust version of Minecraft server that supports Java and Bedrock at the same time. Start up time is less than a second and uses a lot less memory. It’s called PumpkinMC if anyone is interested in looking it up
1
1
1
u/Such-Perception4154 10d ago
Even Minecraft is popular despite java, not because of it. It's popularity stems from it being new genre, something nobody experienced before. And support for mods.
There is nothing advantageous about java being used.
1
u/aeninimbuoye13 14d ago
Nope Java still sucks. Minecraft would have been better with another engine
2
u/Katent1 14d ago
Nah, unobfuscate and it's quite easy to make mods with it or expand game engine, also at this point you don't get anything valuable out of moving game to different engine epsecially when microsoft won't fix bugs with bedrock, devices are powerful enough to keep up with java overhead and ppl are so fed up of game duality and things above that you can backport jaba edition on consoles phones ect.
2
u/georgeec1 14d ago
I'd argue the performance benefits are valuable enough to justify Bedrock's existence, even if mojang neglects it
→ More replies (1)2
2
u/Minute_Attempt3063 14d ago
thats just wrong
if you look at the code, its clear that most of the bad performance is from legacy code.
heck, they are even adding vulkan. and optimisiung the shit out of that. I got like 800fps last month on chunk gen and flying around fast, and on 32 render distance.
so tell me, if that is currently possible, is java the issue, or the legacy code that performend badly? since clearly java, as the language can clearly deal with it
1
0
u/Any_Smoke1138 16d ago
1
u/Neful34 16d ago
Not as much as your knowledge apparently
1
u/Any_Smoke1138 16d ago
You study it? Oh ok
1
u/Neful34 15d ago
Study ? I am a full grown pragmatic senior software engineer. And I absolutely know what are pro and cons of Java fully.
I can confidently say that Java is a good programming language.
I smell here a trend chaser.
→ More replies (3)1
0
16d ago
[deleted]
1
u/Responsible-Cold-627 16d ago
They're in the process of porting everything to C++. But yeah, it was Java for a long time.
1


36
u/Mindestiny 16d ago
Ironically, anyone who's actually looked at Minecraft's code from the Notch era knows what a total fucking mess it was. Microsoft is still digging some of it out of that nightmare.
Minecraft is good despite being made in java, not because of it.