[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/v/ - Video Games

Name
Spoiler?[]
Options
Comment
Verification
4chan Pass users can bypass this verification. [Learn More] [Login]
File[]
  • Please read the Rules and FAQ before posting.

08/21/20New boards added: /vrpg/, /vmg/, /vst/ and /vm/
05/04/17New trial board added: /bant/ - International/Random
10/04/16New board for 4chan Pass users: /vip/ - Very Important Posts
[Hide] [Show All]


[Advertise on 4chan]


File: C++.png (15 KB, 280x280)
15 KB
15 KB PNG
Why gamedevs still using this programming language??
>>
>>730641921
Good morning saar.
>>
>>730641921
Because it gets you low enough level to do things you couldn't do otherwise while also not wasting your time like going all Chris Sawyer and coding in assembly or something.

Factorio for instance would not be able to be anywhere near as efficient as it is if were made in an engine or in python or something.

>>730641971
It's not C# dumbass
>>
>>730642332
what can C++ do that Python can't? I'm a codelet
>>
>>730641921
It's fast
>>
File: 1718200470991243.jpg (71 KB, 876x695)
71 KB
71 KB JPG
>>730642383
Computers run on assembly instructions (they don't it's actually uops down to binary gates but ignore that).

Assume assembly is the ultimate goal.

Handwriting assembly would be the fastest if you know how to and had the time because it's very verbose compared to languages that compile down to it. Assembly actually is just numbers (bytes) that a processor knows what to do with but usually an assembler is used which converts the assembly text representation to the actual bytes.

Example:
add eax, ecx ; same as eax += ecx

You want as few of these individual instructions as possible and depending on available scheduler ports available the order in which you do these may matter.

C++ compiles down to actual assembly and can optimize extremely well for what's mentioned above. Python is dynamic so instead of compiling down to the assembly it compiles to an emulated assembly which then is in actual assembly so there's always a layer of emulation and slowness between. Some functions in Python can call to native C++ functions and between the strict input and output set it can optimize because it's just calling a native C++ function.
>>
>>730642383
C++ runs faster and lets you manage memory directly. Python is slow and generally a bloated memory hog.
The two major upsides to Python are that it's significantly more readable and can easily use massive third party libraries.
You could code a game entirely in Python, it'd just have to be smaller in scope.
>>
>>730641921
Most popular languages in 2025
>Python
>C
>Java
>C++
>C#
>Javascript
>Visual Basic
>Delphi
>Perl
>SQL
>Fortran
>Rust
>Matlab
>PHP
>Go
>Scratch

Pick your poison
>>
>>730643526
>Handwriting assembly would be the fastest if you know how to and had the time
For clarification, anon is saying assembly is the fastest at run time, not the fastest to code, and while assembly is incredibly efficient, the tradeoff is that different architectures require different assembly instructions. Higher level languages like C/C++ allow someone to code across different types of processors with the same syntax.
>>
>>730641921
C++ is a mess but the sad part is no other language is as powerful and low level in the modern sense as C++.
>>
>>730641921
because it's an established language that despite being shit has plenty of resources for doing things with it.
>>
>>730644312
>assembly is the fastest at run time
Assuming no pathological cases in your code. If you write something in C++, compilers get you several man-centuries of optimization for whatever garbage your write, the speed of assembler is all up to you.
>>
File: file.png (929 KB, 1242x1172)
929 KB
929 KB PNG
Can you really call yourself a real game developer if you haven't written your own programming language with a compiler?
>>
>>730641921
no real reason. the good libs are all in C and any language worth a shit has decent C FFI.
>>
>>730642383
python will be fixed soon. there adding rust to the c version of python.
>>
>>730641921
Because it's fastest and it actually works comparing it to anything else.

Java - works but still jeet lang.
C# - meme.
Rust - troon meme lang it's more broken then C absolutely useless it caused even recent outage of internet.
>>
It's OK to be brown.

Just kidding, no it's not
>>
>>730644696
ok esl
>>
>>730644767
literally rent free
get help
>>
>>730641921
this is all you need, everything else is bloat and therefore useless.
>>
>>730644306
Where is Dart?
>>
>>730644964
Nobody uses Shart
>>
File: 1751756433980894.jpg (62 KB, 706x1000)
62 KB
62 KB JPG
>>730644907
If you're going to read K&R, you should at least read the 2nd edition.
>>
>>730644964
Position 26
https://www.tiobe.com/tiobe-index/
>>
>>730644306
where's cobol
>>
>>730644907
>>730645029
Is there any real non-meme reason to use C over C++?
>>
File: monkfrogs.png (63 KB, 734x605)
63 KB
63 KB PNG
>>730644907
Yeah, you also don't need to take a shower everyday.
However, if your cute little brain can understand the lifetime of variables, C++ smart pointers will halve the amount of memory management code you're writing, and the rest of the program can still be 1488% pure C.
I don't even want to know how painful must life be without templates.
If you're afraid of choices, just be honest about it.
>>
what does the C mean?
>>
>>730645174
It's the successor to B
>>
>>730644306
C + Lua
>>
>>730644306
What game is written in Visual Basic?
>>
>>730645148
cringe
>>
>>730645174
https://en.wikipedia.org/wiki/B_(programming_language)
>>
>>730645148
vased
>>
>>730645101
Probably some industry standards and sheeeit.
Otherwise, 99% of C can be done in C++, and then you can just white/black-list C++ features.
>>
It's been 5 years since I last coded in C++, but I have a few game ideas I want to prototype.
So naturally I'm brushing up by reading the OpenTTD source code.
I've spent most of my career coding entirely in jython so it's a bit of a paradigm shift...
Anyone have any decent tips or guides not written by jeets?
>>
>>730645101
like >>730645262 said, if you do coding for industrial applications (aka not being a filthy neet), it's going to be either C or ladder logic.
>>
>>730645295
Condensed experience on what to do and not to do from the language creator himself
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines
>>
>>730645101
making libs that can be called from other languages
>>
>>730645101
if you want to use the restrict keyword
>>
>>730644306
Call me brown, but C# any day.
>>
>>730645101
making globalists seethe eternally
>>
>>730645378
Neat, thanks.
>>
>C#
>it's nothing like C
>it's actually java
What DID they mean by this???
>>
>>730645617
Brown.
>>
>>730642332
What's wrong with C#?
I'm currently taking a uni class about it since it's required, and it's very similar to Java
Is it a /g/ thing to hate on it?
>>
>>730644306
C++ or C# both are pretty intuitive for me.
>>
>>730645852
a lot of unemployed people have strong opinions on programming languages for whatever reason.
>>
>>730645926
I think they get lost in the sauce. 99% of end users dont give a shit if you're doing something fancy on the backend, so long as the application works.
>>
>>730645852
There's nothing wrong with C#, people just shitpost about it because it's stereotypically used by a lot of Indians.
>>
>>730645852

Largest problem with C# for game dev is garbage collection and how allocations are handled. There's a reason object pooling is a standard practice with Unity.
>>
ive tried learning c++ before and i hated it
i get its a 100 year old language built to work on grandmas dentures, but in the year of our lord 2020+6 i see no reason why there needs to be 30 different types, each with their own unique casting paths that could just be one type like in any "modern" language.

i wish there was a alternative that wasnt rust or just c but again and different
>>
>>730645852
C# is comfy but microsoft has a weird tendency to provide 50 frameworks for the same shit and give them all the same fucking name.
>>
>>730644306
God I hate python so fucking much you have no idea
Whoever came up with the idea of using whitespace instead of brackets for something that isn't running on fucking punchcards needs to be executed
>>
>>730646118
It forces people to keep their code nice & easy to read though.
I actually really like python. The only time it's caught me out is that calling .isnumeric() on a string will return FALSE if the number has a decimal or a negative sign (i.e "-1.0")
>>
>>730645245
What does B mean?
>>
>>730646336
be random
>>
>>730646297
I can also just keep my code clean myself without it throwing errors if I don't do it exactly the way it wants me to
>>
>>730646336
>didn't even read three sentences into the article
>>
>>730646336
just B urself
>>
>>730646738
>B's origin is its advancements take its name away from Z
>the improved version of B goes backwards
?????????
fuck these faggots
>>
>>730646872
sometimes, you just do something because you find it funny
there's no real significance to the names anyways
relax
>>
>>730646336
sHE beLIEveD
>>
>>730642383
Runs several orders of magnitude faster, for a start.

(I’m not shitting on Python here - you need to understand that different languages exist to fit very different purposes)
>>
>>730642332
>factorio
LMAOOOOO That 2D ass game with ugly graphics could run on any pc kekking rn C++ doesn't do anything for it
>>
>>730646987
holy fucking retard
>>
>>730642383

largest differences comes down to how c++ is a compiled language while python-esque languages are interpreted/semi-interpreted. Python is great for prototyping, you can execute code as written without waiting for the whole compile process, but that comes with a performance cost.
>>
>>730642383
Python runs an interpreter that uses C++/Rust libraries, so it's a lot slower and you don't really have the features of C++/Rust. Like you can't write a driver with python even. There is no replacement for C++/Rust. It's low level, which is required for any application to even run and even the OS to run. This is why you're going to get paid a lot of cash for C++, but not for C#, because C++ is fundamentally required for practically everything if you strip away support structures like the net framework, virtual machines (java, python), etc.

Programming languages are tools. You have to weigh the pros and cons yourself for your project and use case. If you're doing short term quick data analysis, then you're going for python because it has very fast prototyping, but you're not going to rely on it where you process terrabytes of data where your interface makes a 100x difference if its written in c++
>>
test
>>
>>730647128
>he thinks writing a bunch of words a different way makes huge differences in performance
LOOOOOOOOOOOOL
>>
>>730647462
it's no fun if you don't even pretend to try
>>
>>730641921
Because there's no real alternative other than Rust, which is a very good language in general, but game devs tend to heavily dislike it since it doesn't allow you to quickly prototype and test things out, often requiring refactors to get something done.
>>
>>730642383
Increase dev time. People will be making millions while you’re still figuring out which pointers point where
>>
A good example is Blender
It's coded in python, It's highly accessible to make plugins and addons for, and to update as freeware
But then Blender then absolutely fucking sucks at repetitive tasks through no fault of the devs but just by how python is - Blender will shit the bed when there are too many vertices on the screen, and take a bajillion hours longer than professional competitors not coded in python or java or some other unoptimized language to render or process tasks.
>>
tl;dr
Languages at a lower level like assembly / C (not in terms of difficulty just in terms of program architecture) is generally much more time consuming and your product is far more efficient (if coded well) for it. Shit is also harder to update and add features to and the more multifunctional your program is the more shit is likely to break and harder to keep the same level of integrity.
Coding at a higher level is generally easier, faster, more accessible, easy to build upon etc etc. You can pump out dozens if not hundreds of apps and programs in these coding languages in the time it takes to make one program in lower level coding where you're doing things like allocating and managing the memory.
>>
>>730647632
Rust blows for the game design part of gamedev because while runtime performance is potentially fast, its compile times are shiiiiiittttttttt
You'll have to constantly wait over 10 seconds for it to compile shit even if you just changed one variable, which is why Rust projects only use Rust on the technical engine end of things, and then integrate a scripting language like Lua for the actual design part of the game so you can tweak numbers on player and NPC stats without having to recompile everything
>>
>>730644306
PH Game Dev master here



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.