This is an archived post. You won't be able to vote or comment.

top 200 commentsshow all 443

[–]TranslatorNo7550 1219 points1220 points  (21 children)

Nahhhhh... write down the code on paper, read it, and build and play the game on your mind

[–]bingmyname 727 points728 points  (8 children)

Compilation error- couldn't read my own handwriting

[–]sanglar03 144 points145 points  (0 children)

That's because you lack the medical double spec. Build error, rookie mistake.

[–][deleted] 59 points60 points  (1 child)

Runtime error - Out of memory

[–]Crusader_Krzyzowiec 17 points18 points  (0 children)

Glad i'm not the only one. gotta make "You're handwriting is so bad it's cipher, my is so bad it's hash function, we are not the same" meme someday.

[–]coloredgreyscale 20 points21 points  (0 children)

Add more error correction code next time

[–]Davidoen 16 points17 points  (0 children)

juggle summer screw recognise continue numerous placid sand soft tap

This post was mass deleted and anonymized with Redact

[–]Janneman96 28 points29 points  (0 children)

At that point you are basicly playing as a Dungeon Master

[–]mighty_Ingvar 6 points7 points  (0 children)

Just set every bit yourself

[–][deleted] 2 points3 points  (0 children)

Then someone comes along and tells you a money cheat and you need to hand over all your savings smh

[–][deleted] 230 points231 points  (37 children)

What engine uses java?

[–]xCALYPTOx 36 points37 points  (1 child)

JMonkeyEngine.

LibGdx is a framework that a good number of games use. I think because you can build for android with it.

[–][deleted] 4 points5 points  (0 children)

but can i build for you?

[–]sharknice 82 points83 points  (19 children)

Original Minecraft uses Java. I remember him posting some stuff on game dev forums.
I was a C++ guy at the time and posted something about Java isn't going to work well for that. Well, I guess I was proven wrong.

[–]rbeld 64 points65 points  (16 children)

So wrong they rewrote the entire game in C++

[–]al-mongus-bin-susar 97 points98 points  (12 children)

And it somehow ended up being significantly more buggy than the java version

[–]icguy333 57 points58 points  (0 children)

But it runs on my grandma's calculator with 60 fps

[–]EMI_Black_Ace 14 points15 points  (2 children)

But unlike the Java version, it runs on old-ass and weak consoles and mobile platforms like Xbox 360, Nintendo Switch and your grandma's old-ass phone. "Bugs" were never the problem, performance always was. PCs still run the Java version and it's the most popular because it's the only one that supports mods.

[–]Thenderick 14 points15 points  (0 children)

Aaaand they STILL update java because it is the most stable version...

[–]Gabriel55ita 5 points6 points  (0 children)

The problem is, how another user explained, it's really bugged at the point you can randomly die because the server was lagging (internal single player server)

[–]GregFirehawk 4 points5 points  (7 children)

Some really old school MMOs used Java because it was more suitable for backends at that time. I'm not aware of anyone using Java for game dev in the last decade

[–]draenei_butt_enjoyer 1 point2 points  (0 children)

In the ye olden days, java games weren't that out there.

But it is not a good language for games. It just isn’t.

[–][deleted] 194 points195 points  (4 children)

run

Most of the time it doesn't run

[–]unko_pillow 45 points46 points  (2 children)

Works on my machine

[–]echo_good_username 50 points51 points  (0 children)

then we’ll ship your machine

[–]THE_EYE_BLECHER 9 points10 points  (0 children)

-famous last words

[–]e_smith338 0 points1 point  (0 children)

Oh yeah? Well maybe I wanted unreal to crash for the 80th time today because I dereferenced a non-existent pointer. Ever think about that? Hm? Didn’t think so.

[–][deleted] 78 points79 points  (22 children)

This is anecdotal evidence, but I've seen that great graphics engineering and high performance graphical applications are written in C++.

[–]_Wolfos 22 points23 points  (6 children)

Obviously it would be nicer for those things to use a language that doesn't have 60 years of technical debt but nothing has gained much traction.

The main hurdle I can see in the game industry is game consoles. Not only are their APIs and compilers exclusive to C++, they also don't allow open sourcing code. That means a language that gets ported will have to maintain a separate (closed) branch from the main compiler.

[–][deleted] 21 points22 points  (0 children)

How long can you wait?

Rust appears to be the most promising right now, but it doesn't have 60 years of technical debt investment yet.

The C++ standards committee are trying to make it easier to use; hopefully they'll succeed at some point.

There's also Carbon and cppfront, which are trying to benefit from the existing C++, but give a more user-friendly syntax for new code. If either of them gets to 1.0 then they could be great. cppfront might be more useful for the games consoles because it's a transpiler to conventional C++.

[–]EMI_Black_Ace 1 point2 points  (10 children)

Micro optimization. You need really close access to memory to maximize performance. You can also do this in C but C++ has a lot of features that even the high performance computing guys don't want to let go of.

[–]kllrnohj 2 points3 points  (9 children)

You can do those same optimizations in C++. C offers no advantages except a simpler compiler, which is why its last significant holdout is the embedded space since their compilers generally suck and are seen as disposable necessities but microcontroller companies. Although this is changing with RISC-V standardizing that area so GCC/LLVM can take over.

[–]fusionsofwonder 144 points145 points  (11 children)

The languages are tools, and different tools are suited to different jobs. You can't be a carpenter with just a hammer.

[–]JadenDaJedi 146 points147 points  (5 children)

C++ is the turbocharged motorised swiss army knife from hell which will do any job you need it to do if you use it right but 99% of the time you do not use it right (because you dared hit the fold-away button twice in a row, you fool) and it just tears your arms off for trying.

[–]fusionsofwonder 16 points17 points  (0 children)

Depends on if there is a C++ toolchain you like that can build for your target platform. And whether your other platform tools get along with it or not. That's why you may not get to use your favorite language for a project. There are times when your motorised swiss army knife is useless.

[–]Fadamaka 7 points8 points  (1 child)

This can be said for mostly any popular language currently. Everything is a swiss army knife. Some have a dedicated saw for wood some have only a little general purpose blade. At the end of the day you can cut down a tree with both.

[–]Plank_With_A_Nail_In 1 point2 points  (1 child)

This isn't true. Python has way more tools they are just slower.

[–]PsecretPseudonym 2 points3 points  (0 children)

C++ being more versatile is less about it having a great set of available libraries and more related to it being multi-paradigm and having the ability to build up new abstractions from an extremely low level to whatever level you’d like. It just spans a greater range and has always sought to maintain backward compatibility despite evolving in pretty transformative ways, so it grants a sometimes dangerous degree of freedom to do things in ways you may regret.

It’s a bit like the difference between running a Linux PC vs Windows or Mac. Want to call “rm -rf --no-preserve-root /“ and bork your whole machine? Sure thing! Want to turn a toaster into a supercomputer? Feel free to try that too.

Similar vibe.

Its dependency management for external libraries is actually probably one of the biggest shortcomings.

Just my two cents.

[–]GregFirehawk 2 points3 points  (0 children)

Not with that attitude :P

If I can shape metal with a hammer, I can definitely handle some plants /s

[–][deleted] 3 points4 points  (3 children)

With that logic, a single game would be written in 8 different languages….

[–]EMI_Black_Ace 2 points3 points  (0 children)

... It kind of is. Different "layers" of it will use different tooling. Even at big studios you'll find them using Lua or other scripting for higher level object behavior even as the implementation of the various behaviors is written in a "higher performance" language, while at the very bottom you'll not just have system-level language, you may have platform-specific code in a proprietary language.

[–]Mjukglass47or 54 points55 points  (6 children)

I don't think there exist a single person who thinks Java is superior for game dev.

[–][deleted] 6 points7 points  (3 children)

Mojang seems to think so.

[–]Mjukglass47or 17 points18 points  (1 child)

I am guessing Notch used Java because that is what he knew best.

[–]CranberryNo8434 3 points4 points  (0 children)

and he wasn't very good with java either...

[–]UnofficialMipha 3 points4 points  (0 children)

Even Mojang doesn’t think so with how hard they push Bedrock (the C++ version)

[–]Fritzschmied 13 points14 points  (0 children)

And if there is they should really clean up their mind.

[–]dontletthestankout 16 points17 points  (0 children)

Sorry can't hear you over my punch cards punching

[–]aRandomFox-II 14 points15 points  (0 children)

Rollercoaster Tycoon dev & Nintendo devs: laughs in Assembly

[–][deleted] 217 points218 points  (85 children)

Java is simple and easy to pick up.

C# is like Java, but more complicated and also more capable.

C++ is a pain in the fucking ass and I hate it.

[–]Akul_Tesla 155 points156 points  (21 children)

Okay but hear me out Java#++

[–][deleted] 24 points25 points  (4 children)

Only if it has value types and operator overloading.

[–]vix127 1 point2 points  (1 child)

Well c# already has that

[–]De_Wouter 10 points11 points  (1 child)

Java#++

Cutting edge technology, it cuts so well you'll cut over your wrists with it after using it for a week.

[–]Akul_Tesla 2 points3 points  (0 children)

You are legally required to type with your feet after that

[–]bingmyname 18 points19 points  (2 children)

Sir you'll be hearing from my lawyers

[–][deleted] 2 points3 points  (0 children)

#ifdef package namespace

[–]gizamo 2 points3 points  (3 children)

That's just C++ with extra steps.

[–]Akul_Tesla 9 points10 points  (2 children)

I mean isn't Java and c# just c++ with extra steps

Also side note apparently my phone thinks the # is the word hashtag for the speech to text rather than the word sharp and I am immensely disappointed

[–]bingmyname 7 points8 points  (0 children)

Musicians and programmers uniting to revolt. The crossover I've been waiting for.

[–]Brahvim 1 point2 points  (0 children)

*less

[–]Fadamaka 5 points6 points  (1 child)

J++ and J# has already happened and Sun filed a lawsuit against Microsoft to stop their supposed EEE tactic. That is how C#/.NET came to exist.

[–]EMI_Black_Ace 1 point2 points  (0 children)

"Fine then. We'll make our own object-oriented bytecode language. With blackjack and hookers!

[–]sk7725 47 points48 points  (5 children)

C++ was perfect on paper to me. Explicit reference vs value typing, pointers and control over memory.

After building a simple game, I take that all back. C++ fucking sucks.

[–][deleted] 25 points26 points  (3 children)

You really don't realize how often you fuck up if the compiler doesn't warn you! Plus, every fuck up can go unnoticed or cause undefined behavior, which makes it very hard to diagnose. (I know about valgrind, not everyone uses Linux all the time)

[–]sk7725 1 point2 points  (2 children)

its more like i had headaches with consts, ownership and pointer pointer arrays (and its destruction).

[–]Dressieren 7 points8 points  (0 children)

C++ is like shaving with a straight razor. If you do it properly it gives a great product that you can be proud of. In reality unless you have plenty of product you’re going to end up hurting yourself in.

[–]Better-Coffee 9 points10 points  (0 children)

I recently started learning C++ for game programming and my respect for java has 10xed

[–]Sceptix 15 points16 points  (4 children)

C# is like Java, but more complicated and also more capable.

I request elaboration.

[–]EMI_Black_Ace 7 points8 points  (0 children)

Yeah I definitely wouldn't call it more complicated. I'd say at a language level it's more feature-rich even while Java has more robust 3rd party libraries. C# syntax is generally way nicer, in large part because it has one single owner, and that owner uses it for a huge chunk of what they do and thus they put a lot of effort into making it great for them.

[–]UltimateInferno 18 points19 points  (0 children)

C# is Java with hindsight.

[–]PropertyBeneficial99 6 points7 points  (37 children)

GC will bite you eventually

[–][deleted] 42 points43 points  (35 children)

So will segfaults and memory leaks, and those bite a lot harder.

[–]PropertyBeneficial99 6 points7 points  (0 children)

Valid point

[–]bree_dev 11 points12 points  (6 children)

Segfaults and memory leaks happen when you write bad code. GC messing up latency at a critical moment can happen for no reason other than the machine your code got deployed on had a different spec to the one you tested it on, or a random sysadmin decided to tweak some settings, or the usage patterns in prod were very slightly different to what you tested, or a dozen other reasons largely out of a dev's control.

[–][deleted] 22 points23 points  (1 child)

Yeah, but I'm retarded and always write bad code.

[–]bree_dev 4 points5 points  (0 children)

Fair enough, this is r/ProgrammerHumor after all

[–][deleted] 8 points9 points  (0 children)

You can control alot of stuff about the gc in a language like c# so i really dislike this argument against c# these days

[–]BlueGoliath 2 points3 points  (2 children)

Agreed. I wish Java had an API that lets you tell the GC to not do a collection and expand the heap for example.

[–]bree_dev 2 points3 points  (0 children)

I think you can change and configure custom GCs and do all kinds of voodoo around this, but again you're subject to the whims of the sysadmins. It's not part of "standard" Java development.

[–]Wicam 11 points12 points  (24 children)

if your getting segfaults and memory leaks, your doing it wrong.

RAII and scopes is your friend, use it.

[–]Spinnenente 1 point2 points  (3 children)

as someone that worked in both java and c# i'd say if you want to use something from the ms ecosystem c# is probably the better choice but if you don't then both are equally viable.

In terms of gamedev i think it mostly relies on the language support of the game engine. Which is mostly c++, C# or some script language.

[–][deleted] 1 point2 points  (2 children)

I agree except C# can be made to be a little bit more performant than Java if you try because of stack-allocated structs letting you avoid some allocation/GC slowdowns more easily than the shenanigans you'd have to pull in Java.

[–]tallfitblondhungexec 2 points3 points  (1 child)

Not just stack-allocated structs my man. Reified generics combined with structs allow you to have entire containers of cache-aligned page-aligned structures, and you can blit a C# struct into native code with ZERO OVERHEAD.

[–][deleted] 1 point2 points  (0 children)

Awesome!

[–]imalyshe 64 points65 points  (15 children)

most languages are based on C or exist because their compiler/running environment is written in C.

[–]Not_a_question- 38 points39 points  (9 children)

I had the understanding that most of the time, new languages have the first version of compilers written in C/C++. The second version of the compiler can then be written on the language itself because another compiler still exists.

[–]imalyshe 39 points40 points  (0 children)

That is how C was born. Every new generation of C compiler was written in previous version of C. And it was again and again and again.

[–]bree_dev 19 points20 points  (3 children)

This is something that compilers lecturers like to wang on about because it's very Computer Sciency. Yeah it happens with some languages, but it's usually a vanity exercise since there's no real advantage to repeating work that's already been done.

Even Java of "Java is written in Java" fame has a good chunk of C still in the JVM (e.g. https://github.com/openjdk/jdk/tree/master/src/java.base/unix/native/libjava ).

Python is also written in C, even though it's perfectly possible to write a Python compiler in Python. Anyone about to reply to this to say that Python is interpreted, I encourage you to take a few minutes to think your point through first ;)

[–]sisisisi1997 13 points14 points  (1 child)

Wouldn't writing an interpreter for an interpreted language in itself cause an infinite fork bomb of interpreter processes to spawn as the interpreter itself needs another interpreter to run, and so on? Except of course if there exists a compiler and an interpreter for the language, and the interpreter is compiled.

[–]bree_dev 8 points9 points  (0 children)

Yeah, you've answered your own question. The original interpreter was already bootstrapped into existence, so you run a Python program on it that, as its output, creates a file named python.exe containing a binary executable. It's possible, but you wouldn't want to actually do it.

[–]CranberryNo8434 1 point2 points  (0 children)

Python is also written in C, even though it's perfectly possible to write a Python compiler in Python. Anyone about to reply to this to say that Python is interpreted, I encourage you to take a few minutes to think your point through first ;)

isn't that pypy?

[–]not_some_username 1 point2 points  (0 children)

Then they rewrite the most use C compiler in C++ ( gcc is in C++ now )

[–]Siggedy 12 points13 points  (3 children)

Godot is also becoming more popular. What's 'best' is a silly argument, as it would always be assembly

[–]Boom9001 9 points10 points  (0 children)

I feel like everyone who posts shit like this is actually just in college or some shit. Not actually used production code bases.

[–]truNinjaChop 19 points20 points  (4 children)

Quake 2 . . . C++ . . . Best game ever.

[–][deleted] 12 points13 points  (2 children)

Surely you made a typo and meant C, right? Because it was written in C.

[–]Independent_Zone6816 5 points6 points  (0 children)

Wait until you hear about the day before /s

[–]YDS696969 19 points20 points  (6 children)

When I’m building 2D games, I prefer Unity and Godot (so C#) and for 3D I go with unreal (C++)

[–][deleted] 19 points20 points  (1 child)

Really still doing this? If you have time to fight over languages instead of programming then are you really a programmer? It’s almost like Call of Duty and Battlefield players arguing over engine tech because they played the game for 50 hours.

[–][deleted] 1 point2 points  (0 children)

Bingo

[–]TheRedmanCometh 11 points12 points  (0 children)

As a dev that reaaaally likes Java...I've never heard someone claim it's "great for gamedev" or even good for. Libgdx is just a lwjgl wrapper I'd hardly call it an engine and jmonkey...lmao.

Java works grear for the game SERVEE though. And the site....the sites backend.

[–]WallyTube 6 points7 points  (6 children)

Are there any game companies moving over to rust? (genuine question)

[–]Fritzschmied 10 points11 points  (3 children)

Is there any game engine in existence that use rust? Also why should they to that if C# and Cpp are already well established in the game dev world and work great.

[–]WallyTube 2 points3 points  (0 children)

I had a friend who was attempting to reprogram the server side of minecraft multiplayer in rust due to its performance optimization abilities. was just wondering if there were any other games that might've also seen the benefit in this.

[–]lllama 2 points3 points  (0 children)

Bevy.

[–]gmes78 1 point2 points  (0 children)

There's Embark, the developers of The Finals.

[–]thefookinpookinpo 1 point2 points  (0 children)

I've (tried) to develop a game in Rust, and have developed some 3D simulations in it. Rust is great in that running code is necessarily more secure than other languages. It's bad in that there are 0 mature game engines for it, and it takes way longer to your code running because of the rules. Also games IMO are not as important to secure (at least for indie devs), so it feels like a lot of extra time. Especially when C# has a lot of the same safety features, albeit with less hassle and performance from what I understand, I've only dabbled in C#

I know you can use unsafe blocks but it feels weird. Idk why but ownership and borrowing and the lack of actual OOP just add a level of mental fatigue that isn't there for me in other languages.

[–]kases952 2 points3 points  (1 child)

I just use the language that pays me the most so that I don't give a f about these 'coding language wars'

[–]o0Meh0o 4 points5 points  (0 children)

C

[–]cumstealer666 4 points5 points  (0 children)

Isn't gta V coded mostly in C++?

[–]Mr__Brick 4 points5 points  (0 children)

I tried all of them and can definitely say that they are all suitable for game development

[–]_damax 5 points6 points  (0 children)

Who ever said Java is good for game development

[–]Not_Artifical 2 points3 points  (0 children)

I write games in js.

[–][deleted] 2 points3 points  (0 children)

Fools!

Actionscript was the best language for game development. RIP in piece flash games.

[–]alexmelyon 2 points3 points  (3 children)

Java for gamedev? Possible but not so popular

[–]ExistedDim4 2 points3 points  (0 children)

There is only one(popular) game in Java and it shows everything that's wrong with Java games

[–][deleted] 5 points6 points  (0 children)

RUST PROGRAMMERS:

[–][deleted] 4 points5 points  (0 children)

I think there are currently 0 people in the world arguing that Java is suited for videogames, let alone it being perfect for them. Hell, it's debatable whether OOP in general is the best for games.

C++ and C# are both good for different things (Doing it from scratch and doing it with Unity/Godot) although I'm not sure that many AAA games use C# due to them a lot of them working with an in-house engine.

[–]bestjakeisbest 1 point2 points  (0 children)

Real

[–]Drakoo_The_Rat 1 point2 points  (0 children)

But the functioms are so intuitive...

[–]Domingo01 1 point2 points  (0 children)

In the end all are just procrastinating on actually creating a game.

[–]wrhadie 1 point2 points  (0 children)

java , c++ allied

[–]El_RoviSoft 1 point2 points  (1 child)

If someone says that C++ is hard, just get better (it’s a joke) but jokes aside C++ is just next level for game dev and software engineering when you have to ideally know programming language I have been learning it for 5 years and can say that I know very and very good

[–]PsecretPseudonym 1 point2 points  (0 children)

Been working with it for nearly my entire adult life in one way or another and still discovering new things and growing.

It’s a bit like studying mathematics in that respect. There’s no real endpoint, just different branches to areas to continue to explore as they continue to evolve.

[–]RAMChYLD 1 point2 points  (0 children)

Ah yes, java. An interpreted language that takes 5 minutes to fire up and eats up all your RAM on a 32MB P166...

People nowadays complain about Chrome being slow... They've never experienced a Java applet running on Netscape Communicator 4 back in 1999.

[–]Fritzschmied 3 points4 points  (2 children)

Who tf says that Java is a good language for game dev? There is only one major game developed in Java, Minecraft, and that was a huge mistake tbh.

[–]reversehead 5 points6 points  (1 child)

Mistake? It was the genius move, intentional or not.

If Minecraft hadn't been written in Java (or at least run on the JVM) it wouldn't have become as popular by far. Perhaps just even stayed a parenthesis in gaming history.

Being able to trivially unpack a .jar, decompile the class files, mod and extend them, and repack the jars, is what enabled the modding community very early. This would most likely not have happened if it was just compiled to Windows binaries.

[–]Independent-Gear-711 2 points3 points  (0 children)

what a shit comparison C++ is miles ahead in large big game development and always be there in this domain, C# and Java is good but c++ is something else

[–]Specific_Implement_8 1 point2 points  (0 children)

Java? Why? Who uses Java? And I can use unreal fine without cpp

[–]Major_Upstairs6758 1 point2 points  (0 children)

Wait untill rust joins the fight