Thread 715865647 - /v/ [Archived: 157 hours ago]

Anonymous
7/19/2025, 9:54:51 AM No.715865647
images(2)
images(2)
md5: 99e5dc2cf254ead26e01b2966fa6895c🔍
What makes this particular language the cornerstone for developing videogames?
Replies: >>715865793 >>715866818 >>715866945 >>715867245 >>715867532 >>715867864 >>715868042 >>715868428 >>715869009 >>715870017 >>715872147 >>715874272 >>715876293 >>715876973 >>715877280 >>715880747 >>715886623 >>715889831 >>715891264 >>715891335 >>715892675 >>715895590 >>715895818 >>715895952 >>715895952 >>715900247 >>715901601 >>715902184 >>715903038 >>715907156 >>715909009
Anonymous
7/19/2025, 9:58:16 AM No.715865793
>>715865647 (OP)
doesn't support user defined genders
Replies: >>715879838 >>715898751 >>715905123 >>715905182
Anonymous
7/19/2025, 9:58:26 AM No.715865802
cheap high-level abstractions
Anonymous
7/19/2025, 10:22:02 AM No.715866818
>>715865647 (OP)
its good
Anonymous
7/19/2025, 10:25:37 AM No.715866945
>>715865647 (OP)
because it's just C with more features. it's still a bloated mess but at least it doesn't force them on you
Replies: >>715878297 >>715903509
Anonymous
7/19/2025, 10:29:43 AM No.715867095
1734652300425156
1734652300425156
md5: 54a93c0c7a076c4d4be3abe841c7ecb4🔍
This + SDL is all you'll ever need
Replies: >>715867148 >>715867289 >>715868178 >>715869626 >>715882459 >>715892990 >>715895859 >>715900396 >>715900587 >>715900986 >>715902440 >>715910229 >>715912090
Anonymous
7/19/2025, 10:31:20 AM No.715867148
>>715867095
raylib is better
Anonymous
7/19/2025, 10:33:07 AM No.715867224
d1eb60174836751cd611f1caa330715c
d1eb60174836751cd611f1caa330715c
md5: d1eb60174836751cd611f1caa330715c🔍
Is C++ really as difficult to learn as people make it out to be, or is it just all a meme? I hear that it's confusing compared to regular C, but I've watched a two-hour video before of some guy who haven't touched the language before but was able to make a game out of it for the Nintendo DS
Replies: >>715867309 >>715867739 >>715868968 >>715870017 >>715870080 >>715872147 >>715875871 >>715876293 >>715877087 >>715878109 >>715878218 >>715880786 >>715880896 >>715882937 >>715883094 >>715883815 >>715887026 >>715888562 >>715889945 >>715894486 >>715895803 >>715895945 >>715897221 >>715902149 >>715903681 >>715903808 >>715907776 >>715907813 >>715908106
Anonymous
7/19/2025, 10:33:38 AM No.715867240
*implicitly converts ur object*
Anonymous
7/19/2025, 10:33:46 AM No.715867245
>>715865647 (OP)
It doesn't. Almost every game from the 70s up to the PS2 era were written in either assembly or C. C++ didn't catch on until the XBox 360 and PS3 generation.

Also, C++ is a dogshit language for games. Ask any C++ developer and they'll tell you that they basically code in a C-style way, just with .cpp file extensions. A lot of C++ "features" like the STL are totally ignored, for instance.
Replies: >>715867356 >>715870538 >>715878535 >>715891753 >>715905725
Anonymous
7/19/2025, 10:34:46 AM No.715867289
>>715867095
Agreed.
Anonymous
7/19/2025, 10:35:12 AM No.715867309
>>715867224
Any of the big languages is fine to learn programming with. C++ just has things inherited from C if you want to be more optimal, but no student needs to start with those
Anonymous
7/19/2025, 10:36:05 AM No.715867356
>>715867245
>Ask any C++ developer and they'll tell you that they basically code in a C-style way, just with .cpp file extensions
Did you get this opinion from your twitch streamer?
Replies: >>715867425 >>715891753
Anonymous
7/19/2025, 10:37:51 AM No.715867425
>>715867356
I got it from Casey Muratori and Mike Acton.
Replies: >>715870635
Anonymous
7/19/2025, 10:40:32 AM No.715867532
>>715865647 (OP)
In theory? Closer to the metal than C# and in return "more efficient".

In practice? Game projects being as big as they are, the better readability due to programming shortcuts and automatic garbage collection leads to a more efficient system in C# once the project spans a certain level of complexity. To keep C++ to be efficient the amount of work becomes exponentially harder increasing complexity. So C# STARTS as less efficient than C++ out of the box, but given enough time/complexity it often ends up being the more efficient one.

Readability of code is generally underappreciated and in a team project it can absolutely be worth it to sacrifice a bit of code efficiency if it means the code is much more readable because code that is readable is code that can be maintained for many years to come by multiple people beyond the guy that initially wrote it (and even the initial author will likely forget it within a few months of writing the code).
Replies: >>715867592 >>715867826 >>715871041
Anonymous
7/19/2025, 10:42:04 AM No.715867592
1741139268165338
1741139268165338
md5: f64d93d9eb8a01c043cf883fdc61be51🔍
>>715867532
>automatic garbage collection leads to a more efficient system
Replies: >>715867960 >>715903071
Anonymous
7/19/2025, 10:45:47 AM No.715867739
>>715867224
Just a meme
>hear that it's confusing compared to regular C
Because c++ came with more tools. Like in C you need to make data structure your self while in C++ you can just choose
Anonymous
7/19/2025, 10:48:00 AM No.715867826
>>715867532
Ant this shit is why games have more and more hardware requirements every year while not becoming more complex in visual and technical sense (by optimistic estimate that is, often they are worse.

"Readable" code that jeets can work with is more important than releasing high quality product, and programmers that can properly use a fast programming language are too expensive.

And no, I'm not a programmer and whatever arguments you may have are literally not my fucking problem, because I am a customer, and as a customer, I observe obvious degradation in terms of production quality compared to times where games were made by competent software engineers.
Replies: >>715901923
Anonymous
7/19/2025, 10:48:44 AM No.715867864
>>715865647 (OP)
You can't go with python for good performance in a resource-intensive AAA game.
Anonymous
7/19/2025, 10:50:44 AM No.715867960
>>715867592
>ignores the further clause still determining what anon meant here
>failing at English grammar
OK jeet
Replies: >>715868084
Anonymous
7/19/2025, 10:53:05 AM No.715868042
>>715865647 (OP)
ASM is unreasonable unless you're retrodeving for an older hardware.
C is quite lacking for larger projects.
C++ is a bloated mess.
so people tend to use C++ but just limited parts of it, that make C more flexible, like operator overloading and data structures.
Replies: >>715877950 >>715878535 >>715890068 >>715909127
Anonymous
7/19/2025, 10:53:58 AM No.715868084
>>715867960
>trying to convince people that leaning on garbage collection is better than just properly architecting a system
>calling literally anyone else a jeet
peak irony
Anonymous
7/19/2025, 10:56:04 AM No.715868178
>>715867095
Sure, but I prefer C+++SDL.
Anonymous
7/19/2025, 10:57:21 AM No.715868221
I think C++ is right in the middle of readability and efficiency as far as coding languages go. There's a lot more languages out there that are easier to read and have a lot less cruft, but those won't let you get closer to the metal like C++ does. Most of the time when you're coding games you won't need to worry that much about that kind of hardcore optimization, but when you do need to worry about it, you really need to worry about it. That's why (I assume) alternatives like Rust or whatever the latest language of the month is haven't taken off, besides just the momentum. If there was a better language for coding games, the AAA industry would've taken steps to switch already, but it hasn't happened yet.
Replies: >>715868289
Anonymous
7/19/2025, 10:59:26 AM No.715868289
>>715868221
Stop calling it "coding games" and "coding languages".
It's programming.
I'm sick of this faggot zoomer "coder" nonsense.
Replies: >>715868398 >>715868461
Anonymous
7/19/2025, 11:02:19 AM No.715868398
>>715868289
Brits have always called it "coding" since the 70s/80s. Go watch some BBC specials about the rise of the microcomputers.
Replies: >>715868439
Anonymous
7/19/2025, 11:02:57 AM No.715868428
>>715865647 (OP)
It's C but with more features and comforts, it shouldn't be that surprising. Even if you hate all the bloat it has accumulated over the years, you can just choose not to use those parts of the language and instead do C style C++
Replies: >>715872147 >>715878535
Anonymous
7/19/2025, 11:03:21 AM No.715868439
>>715868398
Then brits have been faggots since the 70s
Replies: >>715881925
Anonymous
7/19/2025, 11:03:52 AM No.715868461
>>715868289
>pro gaming
It doesn't matter if you're a pro at games. Keep it to the e-tournaments/fighting threads.
Anonymous
7/19/2025, 11:17:12 AM No.715868968
>>715867224
I wouldn't say it's hard to use.
But it's hard to understand code since everyone codes c++ in their own way, as there's just so many ways to do things as so many features have been added to it over time.
But what gives it its infamy is the weird hacky techniques that people use to make their own features such as "SFINAE" and "PIMPL" (this one isn't difficult but other programming languages don't do it).
Replies: >>715905351
Anonymous
7/19/2025, 11:18:23 AM No.715869009
>>715865647 (OP)
Do I have to learn Hindi before learning C++
Replies: >>715869069
Anonymous
7/19/2025, 11:19:52 AM No.715869069
>>715869009
Only for Java.
Anonymous
7/19/2025, 11:31:28 AM No.715869571
how come there wasn't a single de/v/ thread for the past week?
Replies: >>715870673 >>715898389
Anonymous
7/19/2025, 11:32:47 AM No.715869626
>>715867095
If that's the case, then post the games you've made with that combo.
Replies: >>715900751
Anonymous
7/19/2025, 11:42:01 AM No.715870017
>>715865647 (OP)
As fast as C but way less brittle.

>>715867224
It's not hard to learn.

Some people seethe about it because it has a very large standard library compared to most languages, and very flexible language features, so you're able to write a LOT of different styles of code in it, and that makes it so that you can learn a particular subset of C++, and have a complete toolkit for everything, and some other dude can learn a different subset of C++, and also have a complete toolkit for everything that doesn't overlap with yours at all - so it's possible to know C++ and write in C++ and then run across C++ that you can't read at all.

Whereas if you learn say Java, you're going to be able to read all Java. If you learn C, you're going to be able to read all C.

If you learned C++ as "C with classes" you're probably not going to be able to read modern C++ that's using all the standard library algorithms and lambdas and such. If you learned modern C++ you're probably not going to be able to read template metaprogramming. If you're not deep on the inheritance sauce, you're going to have a lot of trouble reading inheritance-heavy C++. If you don't work on the standard library and try to read standard library code you'll be appalled. Etc. They're all part of the same language but at the same time they're different languages.
Replies: >>715878535
Anonymous
7/19/2025, 11:43:43 AM No.715870080
>>715867224
It's not
I actually found Java to be harder than C++.

But the problem is there's a difference between being competent and being a master.
Anonymous
7/19/2025, 11:54:07 AM No.715870538
>>715867245
>A lot of C++ "features" like the STL are totally ignored, for instance.
grim
Anonymous
7/19/2025, 11:56:27 AM No.715870635
>>715867425
Ah so you learned it from grifters and clowns.
Replies: >>715871010
Anonymous
7/19/2025, 11:57:16 AM No.715870673
itsover
itsover
md5: aba2d78f820482484b0072a43c9b2eeb🔍
>>715869571
it's over
Anonymous
7/19/2025, 11:59:41 AM No.715870779
it's super flexible. you can develop around templates and generics, which lets you make functions operate on multiple data types. you can overload operators, functions, classes, and so on. you have multiple inheritance so one class and acquire the attributes of several others. it's versatile as fuck, which means it can solve many problems that other languages can't given only one paradigm or design ruleset.
Replies: >>715870973
Anonymous
7/19/2025, 12:03:48 PM No.715870973
>>715870779
Java has all of that but with proper reflection
Replies: >>715871023 >>715877567
Anonymous
7/19/2025, 12:04:37 PM No.715871010
>>715870635
Mike Acton was the lead engine dev for insomniac for over a decade and current tardwrangles unity engine.

Casey is the handmade hero guy who has inspired countless developers. Ginger Bill, the Odin guy came out saying in a recent interview his language wouldn't even exist if not for Casey.

These aren't idiots.
Replies: >>715872147 >>715903098
Anonymous
7/19/2025, 12:04:43 PM No.715871023
>>715870973
It also has dogshit performance because of the JVM.
Replies: >>715871076
Anonymous
7/19/2025, 12:05:08 PM No.715871041
>>715867532
Languages like C# and Java are better for enterprise purposes, but they do sacrifice performance for maintainability. In big projects, there's almost always a moment when abstractions stacked upon abstractions stacked upon abstractions start weighing things down, affecting user experience, and someone has to pinpoint the biggest chokepoints and refactor or optimize these parts to-the-metal.
Anonymous
7/19/2025, 12:06:09 PM No.715871076
>>715871023
You aren't programming embedded systems where you need 2ms response times
>b-but
No, you're not
Replies: >>715871118 >>715871125 >>715871306 >>715872106
Anonymous
7/19/2025, 12:07:13 PM No.715871118
>>715871076
Look at what board you're on.
Performance optimization matters for games.
Replies: >>715871378 >>715871520
Anonymous
7/19/2025, 12:07:19 PM No.715871125
>>715871076
So what?
Anonymous
7/19/2025, 12:11:04 PM No.715871306
>>715871076
all game logic and rendering needs to fit within a 16ms window per frame to hit 60fps, so you’re retarded
Replies: >>715871378 >>715871520
Anonymous
7/19/2025, 12:12:26 PM No.715871378
4899721d4702ec8e8d548201fb6da050-pre_1122_title
4899721d4702ec8e8d548201fb6da050-pre_1122_title
md5: e37c8cd97f776370d102a3cc5605d58f🔍
>>715871306
>>715871118
Replies: >>715871458 >>715871475 >>715877165
Anonymous
7/19/2025, 12:14:20 PM No.715871458
>>715871378
Minecraft is notorious for its garbage performance due to it being written in Java.
Anonymous
7/19/2025, 12:14:38 PM No.715871475
>>715871378
yeah, don’t expect to make anything more graphically interesting or complicated than minecraft in java
Anonymous
7/19/2025, 12:15:45 PM No.715871520
>>715871118
>>715871306
Not him, but pretending high abstraction languages are at fault for shit optimization is a very dunning-kruger take. Properly used, they're fine, because you should not and you are not going to write the graphics renderer with them. In context of games, they really replace things like LUA, which were even worse, and their problem is that more people use them, creating unoptimized abstraction monsters that people blame the tool on. And that's without going into the fact that a bulk of performance issues in games are GPU-bound, with incorrect draw call management, unoptimized materials, etc., which has little to do with the languages themselves.
Replies: >>715872194
Anonymous
7/19/2025, 12:18:26 PM No.715871634
1752813183840639
1752813183840639
md5: 161fc034821c8eab3f1db997052f85ca🔍
Honestly I don't know. The few times I have been privy to in-house C++ code, often running alongside unreal engine for graphics, it has looked like absolute garbage. C++ seems way to verbose to do even simple shit. I think it's just a combination of being the only viable alternative at the time in terms of C's speed but with muh shitty classes and inhertiance, lots of shilling from Bjarne and MIT troons, and obviously adoption by key players using it for engines.

It's not a good language. It oozes tranny like rust. Not comfortable, not simple to pick up. Filled to the brim with legacy garbage and poor design choices which do not make sense in this millenium.
Replies: >>715871707
Anonymous
7/19/2025, 12:19:43 PM No.715871707
>>715871634
I was with you until your obsessions shone through.
Replies: >>715871864
Anonymous
7/19/2025, 12:23:05 PM No.715871864
>>715871707
>obsession is when thing is thrown in your face every day of every week and you notice it
Replies: >>715871927
Anonymous
7/19/2025, 12:24:21 PM No.715871927
>>715871864
You're the first one to bring that shit up in this thread. Kill yourself.
Replies: >>715871982
Anonymous
7/19/2025, 12:25:43 PM No.715871982
>>715871927
there's literally a blahaj thread right now
Anonymous
7/19/2025, 12:28:08 PM No.715872106
>>715871076
nta but i did on a teensy microcontroller that had to provide me a measurement, automation, and control system over the web via node-red with RTOS levels of performance.
Replies: >>715872178
Anonymous
7/19/2025, 12:29:24 PM No.715872147
>>715865647 (OP)
Because it's essentially C but with support for object-orientation, which is important in any developmental task that involves giving objects in code certain properties that allows them to interact with one another, like games or scientific simulations.

>>715867224
It's not confusing at all really. C++ is just a bit more robust in terms of the tools you can use for a project and how things can be designed.


>>715868428
Also C-tards might hate this, but the object-oriented nature of games and simulations makes it a perfect language to use for the medium. Not that you can't use C with games (like people have done before), but as games have gotten more complex, the purely procedural based methods of C just don't cut it in terms of actually making a viable game product or a simulation.

>>715871010
Casey still hasn't finished his game in like a decade now and Mike Acton's credentials aren't that impressive. Even your standard scientific programmer has done more than him.
Replies: >>715878535
Anonymous
7/19/2025, 12:30:06 PM No.715872178
noFilter
noFilter
md5: c215d395c8d3bc7715da604080468f96🔍
>>715872106
akchually real-time just means that you have dealines, i.e. the results you have to return provide 0 benefit after a certain cut-off point, and the actual timing of these deadlines is not defined by the name
Replies: >>715877482 >>715894847
Anonymous
7/19/2025, 12:30:35 PM No.715872194
>>715871520
What are you talking about? If the abstraction has a baseline cost then that has nothing to do with shit optimization. The JVM has unavoidable cost, and it’s pretty heavy. Next you’re going to tell me python doesn’t run like a turd.

Lua wasn’t ever intended for writing heavy core game logic. Its purpose in game dev has always been to let non-software engineers extend the game, like artists or modders. Or to be used for very light logic, like scripted events. In 2025, it has mostly been replaced in function by blueprint style node programming but it’s still useful for novices making small game projects.
Replies: >>715877341
Anonymous
7/19/2025, 12:32:31 PM No.715872289
>everyone on /v/ knows how to code
>0 finished projects
curious
Anonymous
7/19/2025, 12:34:51 PM No.715872384
I'm working on a 3D game with GLFW.
Should I switch to SDL for the extra functionality, or just combing GLFW with other libraries for whatever else I need?
I'm not too far into the game, so I can probably make it work easily enough.
I wouldn't use the built-in graphics stuff in SDL. just the window to draw opengl to.
Replies: >>715872420 >>715872535 >>715872579 >>715872703 >>715873592 >>715895036 >>715902995
Anonymous
7/19/2025, 12:35:52 PM No.715872420
>>715872384
>combing
*combining
not sure what happened there. I'm on desktop, so it's not autocorrect.
Replies: >>715872535
Anonymous
7/19/2025, 12:36:39 PM No.715872458
low-level, organized, fast, powerful, and is still the best language for software development
Anonymous
7/19/2025, 12:38:34 PM No.715872535
>>715872384
>>715872420
You're better off just using SDL since it's more fully featured and more oriented towards game development. You could use GLFW like I am for a robotic simulation project I am working on, but It would be a pain to mix and match it with other libraries to handle inputs, polling, game events and so on.
Anonymous
7/19/2025, 12:39:37 PM No.715872579
>>715872384
I've found SDL3 very intuitive and easy to use, but I've never used GLFW so I don't know how they compare.
If you are really early, I'd at least do some quick prototyping/experimenting with SDL to see if you want to switch over.
Anonymous
7/19/2025, 12:42:52 PM No.715872703
>>715872384
The the version of SDL that has the most compatibility with everything.
Anonymous
7/19/2025, 1:03:52 PM No.715873592
>>715872384
My current engine uses GLFW and I haven't run into a lack of features but I somewhat regret using it as SDL has far better support for platforms other than PC and I've considered porting my game to the Switch. If there's features you need that are in SDL but not GLFW I would for sure use SDL at that point, it's the gamedev standard anyways. Or just try to abstract over everything so that it doesn't really matter which is used and its easy to swap.
Out of curiosity, what functionality does SDL have that you want to use?
Anonymous
7/19/2025, 1:17:54 PM No.715874272
>>715865647 (OP)
It runs on everything, has lots of features, there's plenty of documentation, and it's cheap computationally
Anonymous
7/19/2025, 1:48:14 PM No.715875871
>>715867224
On the surface it's like any other OO language, if you want to write a simple calculator it's gonna be as easy as with Java or C#
However it gives you more control over memory and parallelism, which allows you to be both more efficient and fuck up big time. No garbage collection is a great pajeet filter.
I remember in back in uni when i had to write shit for an exam in x86ASM, it was all compiled trough C++
Anonymous
7/19/2025, 1:55:47 PM No.715876293
>>715865647 (OP)
Manual memory management, compile-time computations, natively compatible with C, allows fast and easy prototyping.
>>715867224
High skill floor, unreachable skill ceiling.
Anonymous
7/19/2025, 2:11:00 PM No.715876973
>>715865647 (OP)
performance, memory footprint and flexibility
everything beyond c/c++/zig/odin/jai is too bloated for videogames which need to run at 60fps
Replies: >>715877743
Anonymous
7/19/2025, 2:13:42 PM No.715877087
>>715867224
For the last time, you don't "learn" a programming language. You learn the rules of programming, then you apply those rules to with a language. There's a reason why you can't just memorize all the syntax and expect to be a good programmer.

All programming is the same, languages only dictate the amount of time it takes to implement something. With JavaScript, it might only take one line to do something that takes c++ hundreds of lines.
Replies: >>715877389 >>715877727
Anonymous
7/19/2025, 2:15:31 PM No.715877165
>>715871378
that has nothing to do with java. it's just that the scope of minecraft's simulation, and the fact that most of it can't be parallelized (due to deterministic simulation order) makes it really hard to optimize. Especially since they keep adding features and new worldgen algorithms that are more expensive to process.
In fact, the c++ version of minecraft achieves better performances because they've gimped almost every feature of the game to make it run smoother. They've heavily gimped a lot of features from the original game; redstone, the spawning algorithm and random ticks, etc.

On the client side, most of the time rendering a frame is spent on the gpu, so not java by all means. Everything java does is process user inputs, build meshes to send to the gpu, send packets to the server (yes even in single-player, ever since 1.13) and that's it.

The only part where java doesn't shine is the memory usage and the GC spikes you'll get after playing for a long time. Especially since the game is known to have had memory leaks for a while. As those accumulate, the GC spikes get more and more extreme, to the point where every 5 seconds your games freezes for 1 second.

In general, java is expected to be between 1.5-2x slower than compiled languages, but that may vary a lot depending on which java features you rely on. If you rely heavily on jvm reflections, then it's gonna run like dogshit, but overall minecraft is pretty well optimized for that.

You'll be surprised to know that many AAA games are in fact coded in some interpreted scripting language, like lua or papyrus (bethesda's). The only C++ code is what's responsible for initializing everything, handling inputs and talking to the GPU via DirectX or Vulkan. But like most games, most of the time is spent by the gpu rendering stuff.

t. modder since 1.6
Anonymous
7/19/2025, 2:18:33 PM No.715877280
>>715865647 (OP)
It's literally just C with classes allowing for OOP. It's got a lot of bloat but if C had classes without the bloat called C+, C+ would be the main gamedev language.
Replies: >>715877321 >>715877472 >>715878535
Anonymous
7/19/2025, 2:19:15 PM No.715877321
>>715877280
That exists, it's called C#
Replies: >>715877363
Anonymous
7/19/2025, 2:19:28 PM No.715877341
>>715872194
You don't make a game's rendering engine using python, java or c++. These languages don't even run on your GPU. You must always use a domain specific language like GLSL for opengl or HLSL for Metal.

If you open any game inside a profiler, you'll find that 95% of the time, your cpu is waiting for the gpu to finish rendering the current frame. The rest of the code, the part that runs on the cpu, doesn't need to be even remotely optimized or fast for a game to hit reliable 60fps.
Anonymous
7/19/2025, 2:20:04 PM No.715877363
>>715877321
Are you retarded?
Anonymous
7/19/2025, 2:20:27 PM No.715877389
>>715877087
>All programming is the same
Javascript doesn't compile to machine code. It's not at all the same as C++.
Anonymous
7/19/2025, 2:22:03 PM No.715877472
>>715877280
>It's literally just C with classes allowing for OOP
Retarded take. Templates alone are language within language, C macros don't come close to that. If you just need classes and OOP, C can do that, for example Linux uses OOP in C all over the place.
Replies: >>715877621 >>715877631
Anonymous
7/19/2025, 2:22:15 PM No.715877482
>>715872178
coding with a timer deadline is absolute hell. Once you start putting many component together, you must ensure that in all code path, the worst case scenario never exceeds that deadline. this can takes month to validate even for mid-sized projects. Thankfully these chips don't fit in a lot of ROM so you're kinda limited to smaller projects.
Anonymous
7/19/2025, 2:23:59 PM No.715877567
>>715870973
Java does not have multiple inheritance of classes, only interfaces.
Anonymous
7/19/2025, 2:25:04 PM No.715877621
>>715877472
OOP was a mistake. The only good part of OOP is virtual dispatching. In C you can just have a pointer to an array of function and be done with it. But they had to slap the whole inheritance thing on top which makes dealing with it a pain in the ass.
Replies: >>715890190 >>715891237 >>715896626
Anonymous
7/19/2025, 2:25:19 PM No.715877631
>>715877472
I'm not saying that C++ is just that, I'm saying that's why it's popular.
You can write just C, using just classes and it works the exact same. Everything else is sometimes nice sometimes not but that's the reason why it became the popular language of choice.
Anonymous
7/19/2025, 2:27:35 PM No.715877727
>>715877087
for the basics this is true, but you will need to know the specific quirks to use it at max potential
you don't have to worry about memory in javascript
Replies: >>715877849 >>715878182
Anonymous
7/19/2025, 2:27:56 PM No.715877743
>>715876973
You'd be surprised to find out that most triple-As video games are in fact written in slow interpretated languages like lua or god forbid, javascript. If you need performances, then you write a better rendering pipeline. That has nothing to do with whatever language you decide to use.

The only exception being simulation-based games like rimworld, df or paraslop where pathfinding and game simulation takes a significant portion of the time.
Replies: >>715877926
Anonymous
7/19/2025, 2:29:49 PM No.715877849
>>715877727
Memory is a bit more than a language specific quirk.
It's fundamental to how computers work.
If you don't know how memory works or how to manipulate it, you're not a programmer, you're a script kiddie.
Anonymous
7/19/2025, 2:31:25 PM No.715877926
>>715877743
>You'd be surprised to find out that most triple-As video games are in fact written in slow interpretated languages like lua or god forbid, javascript.
I'm not surprised because AAA games for the past decade have had dogshit performance for both the CPU and GPU.
Replies: >>715878415
Anonymous
7/19/2025, 2:31:57 PM No.715877950
>>715868042
>ASM is unreasonable unless you're retrodeving for an older hardware.
C/C++ compilers nowadays are so advanced that they write more efficient ASM code than a human can. One of the last great pre-AI achievements in computer science.
Anonymous
7/19/2025, 2:35:04 PM No.715878109
>>715867224
Yeah it's pretty hard. C++ is not for fun and you need to know how your code will compile.
Replies: >>715897290
Anonymous
7/19/2025, 2:36:24 PM No.715878182
>>715877727
>you don't have to worry about memory in javascript
Not worrying about memory management is not the same as not worrying about memory
Anonymous
7/19/2025, 2:37:17 PM No.715878218
>>715867224
programming language difficulty depends on how much you know about actual computers. the more you know, the lower level language you can grasp. retards use lua because its high level but dogshit performance, c++ is much faster than lua but harder to write.
Replies: >>715887026
Anonymous
7/19/2025, 2:38:30 PM No.715878297
>>715866945
C fags are so pathetic and always failed cpp beginners
Replies: >>715898392
Anonymous
7/19/2025, 2:41:14 PM No.715878415
>>715877926
and it has nothing to do with the games' code. it's just that they always choose a shitty pipeline because they want their game to look better than the competition's. Most games since the windows XP era are always written using pure GPU/Driver calls. Even when you use a library (e.g SDL) that runs an abstraction layer over those. Internally these calls are compiled binaries that actually do the stuff you've asked them to.

In fact, most AI slop tools (even chatgpt) is written in python, but that has nothing to do with it's performances, python is just another glue to call the driver routines that gets usually called in video games.
Anonymous
7/19/2025, 2:43:22 PM No.715878535
>>715867245
>Also, C++ is a dogshit language for games. Ask any C++ developer and they'll tell you that they basically code in a C-style way, just with .cpp file extensions. A lot of C++ "features" like the STL are totally ignored, for instance.
>>715868042
>C++ is a bloated mess.
>>715868428
>It's C but with more features and comforts
>>715870017
>It's not hard to learn.
>>715872147
>Because it's essentially C but with support for object-orientation,
>>715877280
>It's literally just C with classes allowing for OOP.

there should be the death penalty for retarded no-coders
Replies: >>715879689 >>715890068
Anonymous
7/19/2025, 3:04:13 PM No.715879689
ue5_demoscript
ue5_demoscript
md5: e6e4e3266cf9d12bc687acac86b65980🔍
>>715878535
talk big eat a fig n00b
Anonymous
7/19/2025, 3:04:14 PM No.715879691
Why is Rust so disliked here? Aside from the fact that it needs more time to mature, but that was never an issue for /v/
Replies: >>715880351 >>715880541 >>715882021 >>715889542 >>715890272 >>715897145 >>715899804 >>715904249 >>715904585 >>715908026
Anonymous
7/19/2025, 3:06:49 PM No.715879838
>>715865793
Go back to /gpol/
Anonymous
7/19/2025, 3:14:44 PM No.715880267
1665867670191465
1665867670191465
md5: 2b5424641b110258c11328804d23d0d1🔍
Anonymous
7/19/2025, 3:16:10 PM No.715880351
1723314541592701
1723314541592701
md5: fff6eccf16ce6f5f862be9d9dcd673df🔍
>>715879691
>15 years old language just needs 2 more weeks to mature
it's basically too old for its average user taste already
Anonymous
7/19/2025, 3:19:04 PM No.715880541
jon_blow
jon_blow
md5: d2e46c7fce4310ced91f9f0c7be11a31🔍
>>715879691
one compiler, depends on Visual Studio, no hardware backwards compatibility, community full of rabid pedo-trannies, memory safety is a myth
Replies: >>715881367
Anonymous
7/19/2025, 3:22:06 PM No.715880747
>>715865647 (OP)
The C family of languages has the best syntax.
That's what I think of when I think of programming is like the C/C++/Java/C# style of formatting.
Stuff like PYTHON and the boomer languages looks too weird.
That's not programming.
Lol.
Replies: >>715881176
Anonymous
7/19/2025, 3:22:42 PM No.715880786
IMG_20250719_152124
IMG_20250719_152124
md5: 23d7f3b480dcf1913152afdd9350742f🔍
>>715867224
C++ is overly complicated because it's a language where the people who maintain it only ever add more stuff to it, and it always has to be backwards compatible, so they never fix poorly implemented old features or rework them, rhey just tack on the fix to the broken system as a new tool/feature in the latest version without fixing said broken system because that would threaten backwards compatibility.

So C++ is basically pic related.
Replies: >>715881019 >>715881110 >>715881521 >>715901134
Anonymous
7/19/2025, 3:24:20 PM No.715880896
>>715867224
To learn? No. But you will never have a full picture of the language, and some of the more advanced stuff you'll probably never have to know.
Anonymous
7/19/2025, 3:26:13 PM No.715881019
>>715880786
My coworker does this to our game engine and it makes blood shoot out of my eyes from the stress
Anonymous
7/19/2025, 3:27:44 PM No.715881110
>>715880786
that is good, I'm sick of updates to things breaking them, maintenance is gay
Anonymous
7/19/2025, 3:28:57 PM No.715881176
>>715880747
> That's not programming because I don't like the way it looks.
Tranny tier.
Anonymous
7/19/2025, 3:32:12 PM No.715881367
>>715880541
>depends on Visual Studio
you can compile with mingw
Anonymous
7/19/2025, 3:33:26 PM No.715881452
file
file
md5: 970e8d0eca7bef17b0c09c2c0c8fa1c5🔍
>program in C++
>have to type in "sexually transmitted disease" every other line
What were they thinking?
Replies: >>715881567 >>715881708 >>715881782 >>715882467 >>715886935
Anonymous
7/19/2025, 3:34:31 PM No.715881521
>>715880786
in business world retro compatibility and stability is king, that's why windows has maintained a monopoly in offices for over 30 years, and why servers run on debian stable
Anonymous
7/19/2025, 3:35:15 PM No.715881567
>>715881452
>being homosexual
have you tried using contraceptives? maybe then aids won't live in your head rent free
Anonymous
7/19/2025, 3:37:13 PM No.715881708
>>715881452
>name isn't a wstring
Anonymous
7/19/2025, 3:38:18 PM No.715881782
>>715881452
>this->
Huh? Somebody who isn't dumb explain why he's dereferencing this
Replies: >>715882073 >>715882158
Anonymous
7/19/2025, 3:40:48 PM No.715881925
>>715868439
Brits have been faggots for decades, maybe even a century at least. They used to be hardcore enough to tell the King to fuck off with his bullshit taxes and trying to abolish Parliament, and when he wouldn't knock it off they held the bloodiest war fought on the island, charged King Charles with treason and beheaded the bastard. Now they're letting the invaders in, suck up their cash and rape their women.
Anonymous
7/19/2025, 3:40:58 PM No.715881934
Is GameMaker's language hard to learn?
Replies: >>715884268
Anonymous
7/19/2025, 3:42:36 PM No.715882021
>>715879691
Most people who dislike Rust got filtered by it.
Anonymous
7/19/2025, 3:43:51 PM No.715882073
>>715881782
this->member is the same as (*this).member
It's just an oddity 'this' is a pointer and not a reference. If it was a reference you could do this.member
Replies: >>715882115
Anonymous
7/19/2025, 3:44:29 PM No.715882115
>>715882073
I'm pretty sure you can just do name = name;
Replies: >>715882223 >>715882270
Anonymous
7/19/2025, 3:45:27 PM No.715882158
>>715881782
this is a pointer.
It's also pointless to ever do this->member because just typing member will always implicitly be the member of this.
That's AI for you though, being retardedly verbose in an attempt to be have more readable code.
Replies: >>715882295 >>715882330
Anonymous
7/19/2025, 3:46:37 PM No.715882223
>>715882115
Oh I didn't actually read it.
You could also write the constructor as Person(std::string name, int age): name{name}, age{age} {}
lel
Replies: >>715882709
Anonymous
7/19/2025, 3:47:16 PM No.715882270
>>715882115
Then you'd just assign the value back into the parameter, retard
Anonymous
7/19/2025, 3:47:38 PM No.715882295
>>715882158
>adds this->
>doesn't add const& or std::move to string argument
sasuga
Replies: >>715882330
Anonymous
7/19/2025, 3:48:22 PM No.715882330
>>715882158
My favorite part is the comment. NO WAY THE CONSTRUCTOR THAT TAKES NAME AND AGE IS THE CONSTRUCTOR TO INITIALIZE NAME AND AGE
>>715882295
I bet you're the kinda nigga who writes a move and a copy constructor
Replies: >>715882594
Anonymous
7/19/2025, 3:50:50 PM No.715882459
>>715867095
I tried it for a little bit and can't find any detailed documentation or at least up to date examples on youtube. How are you supposed to use something like that?
Replies: >>715882507 >>715882564 >>715882970 >>715887017 >>715888612
Anonymous
7/19/2025, 3:50:59 PM No.715882467
>>715881452
I'm pretty sure it's bad practice to have the parameter names in the copy constructor be identical to the class's member names.
The only reason this faggot AI needs to type this-> before the members is to avoid the variable shadowing.
Replies: >>715882635 >>715882709
Anonymous
7/19/2025, 3:51:39 PM No.715882507
>>715882459
Have very specific problems instead of general ones
Anonymous
7/19/2025, 3:52:39 PM No.715882564
>>715882459
>can't find any detailed documentation
You couldn't find the official documentation?
https://wiki.libsdl.org/SDL3/FrontPage
I managed to figure out how to into SDL without looking up any tutorials and just reading those pages, and I'm a newbie proogrammer.
Replies: >>715882805
Anonymous
7/19/2025, 3:53:06 PM No.715882594
>>715882330
yes, I also overload for & and && getters because I'm not h1b1
Replies: >>715882698
Anonymous
7/19/2025, 3:53:39 PM No.715882635
>>715882467
>in the copy constructor
in the constructor*
Not sure why I wrote copy there.
Anonymous
7/19/2025, 3:54:40 PM No.715882698
>>715882594
Based and optimization pilled.
Anonymous
7/19/2025, 3:54:46 PM No.715882709
>>715882467
>I'm pretty sure it's bad practice to have the parameter names in the copy constructor be identical to the class's member names.
Naw, nobody cares. See >>715882223
Replies: >>715882981
Anonymous
7/19/2025, 3:56:15 PM No.715882805
>>715882564
Doesn't look very detailed. I liked Qt's documentation for ther qgraphicsscene visualisation framework more.
Replies: >>715882881
Anonymous
7/19/2025, 3:57:44 PM No.715882881
>>715882805
It doesn't look that detailed because SDL is pretty simple to use.
Anonymous
7/19/2025, 3:58:51 PM No.715882937
>>715867224
It's not hard, but bootcamp webdev niggers with no computer science background don't understand how memory works and make it out to be some black magic feature
Anonymous
7/19/2025, 3:59:27 PM No.715882970
>>715882459
Read comments in headers, they are more detailed than any documentation you come upon online.
Replies: >>715883626
Anonymous
7/19/2025, 3:59:36 PM No.715882981
>>715882709
Just because nobody cares doesn't make it not bad practice.
Anonymous
7/19/2025, 4:01:48 PM No.715883094
>>715867224
just use chatgpt unironically
Replies: >>715883198
Anonymous
7/19/2025, 4:03:31 PM No.715883198
running with scissors
running with scissors
md5: 973ee9142005f0880cc098f0ee99cdb1🔍
>>715883094
But what if I want to use it as a comic relief?
Anonymous
7/19/2025, 4:10:16 PM No.715883626
>>715882970
I'll try doing that next time, thanks.
Anonymous
7/19/2025, 4:13:48 PM No.715883815
>>715867224
Its difficulty comes from being a very bloated language but nothing is stopping you from keeping things as simple as you want.
Anonymous
7/19/2025, 4:22:24 PM No.715884268
TrannyMaker
TrannyMaker
md5: e2bf0b72e77a52a886c6fd5cd5c069da🔍
>>715881934
No, but it's bad
Mess with it for a year or so and move on to Godot or Unity
Replies: >>715884898
Anonymous
7/19/2025, 4:26:39 PM No.715884531
What the FUCK do macros even do?
Replies: >>715884645 >>715885503 >>715885904 >>715886870 >>715902780
Anonymous
7/19/2025, 4:28:29 PM No.715884645
>>715884531
they fuck. really hard and long
Anonymous
7/19/2025, 4:32:49 PM No.715884898
>>715884268
Is GMS 2 good? Does it have indexed color / palette support?
Replies: >>715885803
Anonymous
7/19/2025, 4:42:58 PM No.715885503
>>715884531
If you do:
>#define SHIT "ass"
Before your source code compiles, the preprocessor will copy-paste "ass" anywhere you wrote SHIT.
It's that simple.
Anonymous
7/19/2025, 4:47:39 PM No.715885803
>>715884898
It doesn't, you have to add it manually
The thing with GM is that GML language is really slow, so retro things like that, you have to do in shaders, which really complicates things needlessly.
Though, because it used to be quite popular, there are extensions people have made through the years, like this one:
https://pixelatedpope.itch.io/retro-palette-swapper
So you might be able to squeeze through just modifying existing code, like people do on RPG Maker.
Replies: >>715892145
Anonymous
7/19/2025, 4:49:15 PM No.715885904
>>715884531
not an expert, but from what I understand it's just text substitution at compile time
It can also do function-style stuff, which I use to replace ugly and often called lines with something like FUNC(a,b,x)
Anonymous
7/19/2025, 4:56:22 PM No.715886418
If C is so good, why isn't there D?
Replies: >>715886529
Anonymous
7/19/2025, 4:57:50 PM No.715886529
>>715886418
You're in luck
https://en.wikipedia.org/wiki/D_(programming_language)
Anonymous
7/19/2025, 4:59:13 PM No.715886623
>>715865647 (OP)

OOP is just vibe coding
Anonymous
7/19/2025, 5:02:43 PM No.715886870
>>715884531
On a basic level, optionally enable/disable parts of the code and copy-paste file content inside another file before compilation. On advanced level, there's macro metaprogramming that's as powerful as it is ugly and undebuggable.
Anonymous
7/19/2025, 5:03:40 PM No.715886935
>>715881452
using namespace std; // fuck anyone who cries about it
Anonymous
7/19/2025, 5:04:50 PM No.715887017
>>715882459
ChatGPT
Anonymous
7/19/2025, 5:05:01 PM No.715887026
C How to Program
C How to Program
md5: 90b07fe063db614119a3b62482c587cc🔍
>>715867224
C++ is a committee designed general purpose programming language rather than simply an Object Oriented one. This means that the set of features it has is wide many things feel tacked on with many old things left in the background that have to be backwards compatible. So when a beginner starts it the path to A to B can be obscured by the shear amount of options available, combined with a fairly messy package managing system, and multiple ways to write code due to Templates and backwards compatibility with it's earlier versions, and various build systems, and you get a mountain of things to learn. This very intimidating for a beginner.

Compared to that, C is far easier, and gives you the same amount of knowledge of low level programming without decades of bloat. It's syntax is very succinct and very stable, you can go back 30 years and still easily read it, so mostly everything from old forums remains true. Once you understand pointers, their relationship to arrays, and the standard library, your essentially done. I'd go as far as to say C is an excellent first programming language because of it's simple syntax, influence on other languages, and it's relation to hardware.

>>715878218
I thought Lua had good preformance compared to other interpreted languages due to the LuaJit compiler being written with C and Assembly
Replies: >>715887814
Anonymous
7/19/2025, 5:18:03 PM No.715887814
1743900735993
1743900735993
md5: b7876960197a63b1058ba584749f3769🔍
>>715887026
>general purpose programming language rather than simply an Object Oriented one
How many times do we have to teach you this lesson, Cnile man.
Replies: >>715888280
Anonymous
7/19/2025, 5:25:07 PM No.715888280
>>715887814
c kiddies are known liars and homosexuals
Anonymous
7/19/2025, 5:30:00 PM No.715888562
>>715867224
it was the first one i learned, just from a textbook, and i didn't think it was particularly hard
actually learning other ones after there was a lot of times i'd write shit expecting it to work perfectly fine and it just wouldn't because other languages are typically more restrictive
of course this all depends on your frame of reference, c++ actually has certain restrictions that if you, say, learned c first, might drive you up the wall with you wondering why the standard limits you from doing x when it works perfectly fine in every other language
anyways tl;dr yea i didn't think it was that bad
Anonymous
7/19/2025, 5:30:41 PM No.715888612
>>715882459
Like the other guys said, you CAN learn SDL from the wiki and the header comments, but of course there are tutorials too:
https://wiki.libsdl.org/SDL3/Tutorials/FrontPage
Anonymous
7/19/2025, 5:44:46 PM No.715889542
1736241542988071
1736241542988071
md5: 248c127e1a98bdcc07e743c278484e5b🔍
>>715879691
It genuinely filters everyone the first two times they try it
Once you've got the actual majority of the syntax and control flow down it becomes fast to learn because you're just reading more of language from the documentation to learn the standard library and the language features. Every detail being marked up explicitly eg. between variables and mutables or passing by reference or by moving values in. By fumbling around in Rust a lot of decently written C++ turned readable for me.

One massive upgrade to C++ is that things are what they say on the tin, there's no jungle of ten different versions of a same or almost same function written at a different time than what you should be working with. This matters especially when learning.
Replies: >>715891423 >>715901025
Anonymous
7/19/2025, 5:45:58 PM No.715889614
okay but how do i make my 2d rpg in 1 month?
Replies: >>715894356 >>715898285
Anonymous
7/19/2025, 5:49:28 PM No.715889831
>>715865647 (OP)
just use c
+1 is just bloat
Replies: >>715889949 >>715890028
Anonymous
7/19/2025, 5:50:54 PM No.715889945
>>715867224
wait until you hit compile and get alien error message
Anonymous
7/19/2025, 5:50:57 PM No.715889949
>>715889831
but how do i use it to make my game?
Replies: >>715891030
Anonymous
7/19/2025, 5:52:10 PM No.715890028
>>715889831
c kiddies are known liars and trannies
Replies: >>715890138
Anonymous
7/19/2025, 5:52:47 PM No.715890068
>>715878535
>there should be the death penalty for retarded no-coders
>>715868042 was right about C++ being (in large part) a bloated mess. Basically C with OOP forcefully tacked on in an overdesigned yet messy way. Templates are kino, tho.

But overall, C ANSI still feels so much more pleasant to use for me.
Replies: >>715890138
Anonymous
7/19/2025, 5:53:31 PM No.715890138
>>715890068
see here >>715890028
Anonymous
7/19/2025, 5:54:11 PM No.715890190
>>715877621
>OOP was a mistake
yeah thinking this
Replies: >>715890650
Anonymous
7/19/2025, 5:55:17 PM No.715890272
>>715879691
sounds like you spend all your time getting it to compile rather than actual development
Anonymous
7/19/2025, 6:00:37 PM No.715890650
>>715890190
It's a very common trope in the IT industry.
1. Imagine a new architecture/tech/pattern that will save us from technical debt, bad code and improve productivity.
2. Push to absurd and idiotic extremes (ie : see Java OOP hell)
3. Back to step 1

In the end, nothing beat having good and competent programmers on board, everything else is secondary.
Anonymous
7/19/2025, 6:06:17 PM No.715891030
>>715889949
put char's into arrays to make names, texts and ASCII tilemaps and just print that shit to console.
(be really careful to always only read and write inside the arrays, otherwise you do the most classical programming oopsie)
have some numbers that hold some x and y positions of some dudes and some objects, paint them at those coordinates into your screen or whatever and then move them around by changing the x and y values (make the actual game happen here)
have one big enum like "GameState" with variants for all the game situations like main menu, options menu, overworld, town, battle, cutscene or whatever situations your game's made up of. Then run the appropriate part of code based on what this gamestate is. now changing the game state variable will change the game mode, like from main menu to new game etc.
Replies: >>715907494
Anonymous
7/19/2025, 6:09:03 PM No.715891237
>>715877621
You don't struggle with a lack of polymorphism in C?
Anonymous
7/19/2025, 6:09:22 PM No.715891252
i like programming. what do people do in c++ nowadays? i thought games moved to c# and stuff but idk i'm out of touch.
Replies: >>715891839 >>715892225
Anonymous
7/19/2025, 6:09:38 PM No.715891264
>>715865647 (OP)
Speed. Hardware is designed around it.
Anonymous
7/19/2025, 6:10:42 PM No.715891335
>>715865647 (OP)
Inertia
Thankfully much better designed languages such as C# are taking over now
Anonymous
7/19/2025, 6:11:49 PM No.715891423
>>715889542
i hate rust because it's full nanny
>oh no you can't compile this, you're leaking memory
yes i fucking know i'm leaking memory, this is a test run to see if shit crashes immediately or later, i'll deal with the "leak" later
>but then you should explicitly declare that you are using unsafe rust and i'll still complain because you're not supposed to ever ever use unsafe rust because it's unsafe and you can get hurt
fuck off
>also you can't touch this memory, it's from another function
yes, it's my memory and i need it, i got the pointer let me fucking use it
>no compile for you
Replies: >>715891997
Anonymous
7/19/2025, 6:13:53 PM No.715891569
file
file
md5: 467b398bce8a2e95d3b5b2c631e9bf9f🔍
Jai will save us.
Anonymous
7/19/2025, 6:16:37 PM No.715891753
file
file
md5: a5c0cb069a7c2af4a60a98e0cd643c64🔍
Internet discussions in a nutshell:
>>715867245
>>715867356
Neither party either proves their claims or debunk it. Instead we use appeal of authority on the issue.
The reason for this (I'm paraphrasing Acton from his talk) is that C++ STL/newer features are too general and thus too slow for the problem. E.g. virtual methods: looking up which function to use takes too much time. Exceptions/templates too take up too much computing time.
This is why C (or C++ in C style) is used in these spaces: because the language ITSELF is just a fancy assembler. You can get comparative assembly to C code that you cannot with C++, which might not seem like a lot, but can add up. But even he says that assembly would have been the language of choice if infinite time was on the table.

Next time you guys debate something, actually TALK about it, don't quote fags on the internet.
Replies: >>715892735 >>715892997 >>715900896 >>715902076
Anonymous
7/19/2025, 6:18:15 PM No.715891839
>>715891252
C# is for unity scripting.
Anonymous
7/19/2025, 6:21:04 PM No.715891997
>>715891423
>>oh no you can't compile this, you're leaking memory
Considering leaking memory is not just memory safe but also a purposeful feature you don't trigger accidentally in Rust I gotta ask, wtf are you smoking?
>>also you can't touch this memory, it's from another function
As in heap memory you allocated in another function? If it was in form of a stack-allocated smart pointer to heap (like String), then that heap memory gets deallocated when that stack-allocated String goes out of scope. Either you carry the smart pointer over like return the String and you actually have it, or no you didn't actually have the memory and that's why it doesn't even compile.
Figure out what new() and drop() on most things actually do and it gets easier to understand. If you were instead toying with something in the global memory then good luck nothing else.
Anonymous
7/19/2025, 6:23:10 PM No.715892145
>>715885803
Alright probably will stick to my opengl game then. I still havent figured out sprites but whatever
Anonymous
7/19/2025, 6:24:34 PM No.715892225
>>715891252
c# is not c, it's fucking java 2, and microsoft has dropped it and went with golang instead lmao
of relevant things, only unity still uses c#, but you shouldn't be using unity
Anonymous
7/19/2025, 6:30:47 PM No.715892675
>>715865647 (OP)
it's old and well-known
Anonymous
7/19/2025, 6:31:45 PM No.715892735
>>715891753
>The reason for this (I'm paraphrasing Acton from his talk) is that C++ STL/newer features are too general and thus too slow for the problem. E.g. virtual methods: looking up which function to use takes too much time. Exceptions/templates too take up too much computing time.
my iq just dropped by like 20 points reading this
Replies: >>715893927
Anonymous
7/19/2025, 6:35:13 PM No.715892990
file
file
md5: d686dcd8552b299c8fd206408fb23ac2🔍
>>715867095
>open source
Anonymous
7/19/2025, 6:35:18 PM No.715892997
1743834836335
1743834836335
md5: b4cc70872d6f09060c8014e7cdb35be3🔍
>>715891753
You're utterly clueless, non-trivial C codebases roll their own vtable implementation, or even use double dispatch in non-performance-critical sections. And with C++ compiler is aware of vtables and tries to aggressively optimize them away, which in C you'd have to painstakingly do manually.
Replies: >>715893213 >>715893254
Anonymous
7/19/2025, 6:38:45 PM No.715893213
>>715892997
book source?
Replies: >>715893269
Anonymous
7/19/2025, 6:39:24 PM No.715893254
>>715892997
Why would you store void pointer instead of an index to a table of functions or to a switch-case that had all the functions?
Anonymous
7/19/2025, 6:39:39 PM No.715893269
>>715893213
game engine architecture
Replies: >>715893453
Anonymous
7/19/2025, 6:42:42 PM No.715893453
>>715893269
im not buying a book full of stolen techniques. I he's ok with stealing than he should be on with me pirating
Replies: >>715893591
Anonymous
7/19/2025, 6:44:37 PM No.715893591
>>715893453
it's ok to be poor anon
Replies: >>715893757
Anonymous
7/19/2025, 6:47:11 PM No.715893757
>>715893591
never said it wasnt
Anonymous
7/19/2025, 6:49:42 PM No.715893927
>>715892735
What's supposed to be the problem here? Besides whatever it does for the CPU caching and lookahead when the actual code is behind more pointer, the less specific and more general the code the compiler must generate, the less the compiler can optimize the generation of that code.
Replies: >>715894552
Anonymous
7/19/2025, 6:55:31 PM No.715894356
>>715889614
Start with a level editor
Anonymous
7/19/2025, 6:57:40 PM No.715894486
>>715867224
Any individual part of it is simple enough to understand but when you mix all of them together, along with years of new C++ versions adding more and more convoluted stuff, people coding however they please, preprocessor magic, bugs and pointer fuckery it becomes very complex and hard to follow.
Anonymous
7/19/2025, 6:58:46 PM No.715894552
>>715893927
>the less specific and more general the code the compiler must generate, the less the compiler can optimize the generation of that code
source: it was revealed to me in alcohol-induced delirium
Replies: >>715896223
Anonymous
7/19/2025, 7:01:35 PM No.715894754
1741819971988130
1741819971988130
md5: 0ccd2233d91b486f6de18c6647487b52🔍
>game engines don't make sense to me
>coding the whole thing makes sense to me
>everyone says making game this way is impossible
Replies: >>715895242
Anonymous
7/19/2025, 7:02:41 PM No.715894847
>>715872178
based fellow real time systems course taker
Anonymous
7/19/2025, 7:05:08 PM No.715895036
>>715872384
if you make the right refactors this shouldn't be a big lift
Anonymous
7/19/2025, 7:07:46 PM No.715895242
>>715894754
I think some people have a special kind of autism where they don't work well with high-level abstractions unless they know exactly how everything works under the hood.
If you're working with some commercial engine, you don't know what the fuck's going on in there.
If you make your own engine, you know exactly how everything works and how to get it to do what you want.
I'm like that too. One day I'll finish my engine, so I can finally make my game.
Replies: >>715895321
Anonymous
7/19/2025, 7:08:09 PM No.715895265
I haven't coded/programmed in a long while and have been slowly getting back into it. What's a good game engine to learn and use if I want to get into making 2D/2.5D games with C++?
Replies: >>715896608
Anonymous
7/19/2025, 7:09:01 PM No.715895321
>>715895242
x86 asm is interpreted by CPU, it's not precise. Have a nice day.
Anonymous
7/19/2025, 7:09:23 PM No.715895346
c++ny
Replies: >>715895458
Anonymous
7/19/2025, 7:11:01 PM No.715895458
1724552199585237
1724552199585237
md5: a436aec59dfde515afc34c016b6170cb🔍
>>715895346
>cppreference.com
Anonymous
7/19/2025, 7:12:58 PM No.715895590
>>715865647 (OP)
Sega Mega Drive Assembly
Anonymous
7/19/2025, 7:16:24 PM No.715895803
>>715867224
For me, it's hard to learn, because I started with C and when I moved to C++ I realized pretty quickly that like 90% of the features it has I don't like and don't want to use, and I'd rather stick to a mostly C programming style, and as a result I never build up familiarity with C++ code features so when I go to read somebody else's C++ code it's unintelligible gibberish to me. In theory, I could fix this problem, but as a solo hobbyist with no aspirations towards becoming a professional, I've yet to find a reason compelling enough to bother. If you actually want to program C++ professionally, you presumably would need to dedicate a good chunk of time to learning all the ins and outs of the language's features, even the parts that only belong in a chicken nugget.
Anonymous
7/19/2025, 7:16:40 PM No.715895818
>>715865647 (OP)
One of the few things the OOP paradigm is actually good for is video games. Most other applications do everything possible to not use OO features in C++, or use them in a way that subverts the intended OO functionality, because OO is shit for literally every other application.
Replies: >>715896014 >>715907447
Anonymous
7/19/2025, 7:17:25 PM No.715895859
>>715867095
SDL3 is magical so far
Replies: >>715895927
Anonymous
7/19/2025, 7:18:10 PM No.715895920
snibsnab
snibsnab
md5: ceb05c65f65798631464e0f8370a6262🔍
It's over, sepple is DEPRECATED.
Replies: >>715896408
Anonymous
7/19/2025, 7:18:16 PM No.715895927
>>715895859
Elaborate
Anonymous
7/19/2025, 7:18:29 PM No.715895945
>>715867224
Learning it is easy. Debugging it however is extremely gay and tedious due to the actual cause of a problem like a dangling pointer not crashing until possibly a very long time after the cause. Also the compiler error messages are the worst shit you'll ever see in your life. I feel like I do more work trying to decipher them than actually programming.
Anonymous
7/19/2025, 7:18:33 PM No.715895952
1I
1I
md5: 9e440fce166ce06f03550b7aba2f27a3🔍
>>715865647 (OP)
>>715865647 (OP)
>Duuude just use Godot, it's le beginner friendly!!
>it's literally indecipherable
>try Unity and Unreal
>also impossible

I now respect gamedevs.....
Anonymous
7/19/2025, 7:19:32 PM No.715896014
>>715895818
GUI is primary usecase for POOP, with videogames you have to actively use DoD if you're CPU-bound.
Anonymous
7/19/2025, 7:22:45 PM No.715896223
>>715894552
It's not some rocket science, the compiler can't for example inline otherwise inlineable functions if it only knows you're calling functions from some function pointer.
Replies: >>715896716
Anonymous
7/19/2025, 7:25:55 PM No.715896408
1750702545663769
1750702545663769
md5: ffa28630618eb1ee45f744ed1255a7bf🔍
>>715895920
Replies: >>715897256
Anonymous
7/19/2025, 7:28:37 PM No.715896608
>>715895265
Defold iirc uses C++.
You should probably use SDL and make your own basic 2D engine, it's not that complicated.
Anonymous
7/19/2025, 7:28:53 PM No.715896626
1473893094845
1473893094845
md5: 53839228c21abbd5e7d08df7050ead4c🔍
>>715877621
>OOP was a mistake.
everytime I hear this, my eyes gloss over and I remember that most programmers in the world are python and javascript users. And then it clicks why such shit tastes like this exist in the wild.
Anonymous
7/19/2025, 7:30:12 PM No.715896716
1743202801371
1743202801371
md5: d90d0c50715e261a42f05edc514b2b57🔍
>>715896223
Ah, you mean C is slow because it's stuck with function pointers. That's common knowledge.
Replies: >>715897257 >>715897469
Anonymous
7/19/2025, 7:36:06 PM No.715897145
>>715879691
It is Javascript of system programming that managed to attract tranny subculture / cult
It has extremely poor standard library and relies on 3rd party packages to do basic things
Plus borrow checker is just training wheels that hinder your progress instead of helping you
Anonymous
7/19/2025, 7:37:07 PM No.715897221
>>715867224
The problem with C++ is that there's always a million different ways to accomplish the same thing and no agreed upon standard on what the best way is. As an autist I can't handle that kind of freedom.
Anonymous
7/19/2025, 7:37:41 PM No.715897256
>>715896408
damn, it is actually well put together and 100% true
Anonymous
7/19/2025, 7:37:42 PM No.715897257
>>715896716
all that speed and no one to maintain it...
Anonymous
7/19/2025, 7:38:11 PM No.715897290
>>715878109
You mean you need to be aware of implementation-defined behaviour? Because if you mean that, you're wrong. Relying on undefined behaviour in C++ is a sign of a bad programmer.
>But how can anyone know which behaviours are defined?
Read the standard.
Replies: >>715898147 >>715898436
Anonymous
7/19/2025, 7:40:49 PM No.715897469
>>715896716
They're also slow for the similar reason why vtables are slow. Or, why the access through pointer in the example text is slow. The compiler can make less assumptions beyond all sort of pointer use to optimize the code and dereferencing is still slower than having the thing at hand in your your stack frame. But this has jack shit to do with language and more about how much indirection you use, beyond the fact that C++ abstractions allow you to make total spider's webs of pointers which does slow shit down.
Replies: >>715897893
Anonymous
7/19/2025, 7:46:35 PM No.715897893
>>715897469
vtable is actually slower than just a call through function pointer, but it does more than you can do with the latter. I'm not going to read you a lecture about good software architecture design or why decoupling is important in large codebases.
Replies: >>715903307
Anonymous
7/19/2025, 7:50:15 PM No.715898146
we have both indie and AAA devs writing code that loops through all objects on tick, if you're worrying about 1 picosecond of cpu time on a virtual function call you're focused on the wrong things for game development
Anonymous
7/19/2025, 7:50:16 PM No.715898147
leech
leech
md5: 379e6f90f116351196cc09c7733d2eff🔍
>>715897290
>Read the standard.
AAAIIIIIIIEEEEEEE NOOOOOOOOOOOOO
Replies: >>715898608
Anonymous
7/19/2025, 7:52:14 PM No.715898285
>>715889614
Use RPGmaker and ruby
Anonymous
7/19/2025, 7:53:46 PM No.715898389
>>715869571
I don't know. There's even less of the usual green gay dragon shit flinging, and last thread I've seen was very tame and civilized.
Anonymous
7/19/2025, 7:53:48 PM No.715898392
>>715878297
He's right. It's pretty common for game developers to use C++ as "C with convenience features".
Replies: >>715898487
Anonymous
7/19/2025, 7:54:32 PM No.715898436
>>715897290
>But how can anyone know which behaviours are defined?
by running a linter altho it doesn't always help, I just recently tripped over accessing an uninitialized std::optional, no warning from clangd or cppcheck, only abort from asan
Anonymous
7/19/2025, 7:55:16 PM No.715898487
>>715898392
"game developers" are not serious devs. I mean lol. lmao even.
Replies: >>715898647
Anonymous
7/19/2025, 7:56:57 PM No.715898608
Armor_of_Unfeeling_(large)
Armor_of_Unfeeling_(large)
md5: 762261c01a0977e0b8defda64d2a09ca🔍
>>715898147
You WILL read the standard and you WILL be happy.
Anonymous
7/19/2025, 7:57:31 PM No.715898647
>>715898487
some of them are alright, like factorio devs
Replies: >>715898909
Anonymous
7/19/2025, 7:58:50 PM No.715898751
laugh-nicholas
laugh-nicholas
md5: 076f434795f85a50197826dfea5a5145🔍
>>715865793
kek
Anonymous
7/19/2025, 8:00:54 PM No.715898909
>>715898647
and they are not using C++ as "C with convenience features". because that is only something a mongoloid would do (-> self proclaimed "C devs")
Replies: >>715901001
Anonymous
7/19/2025, 8:12:12 PM No.715899804
>>715879691
the compile times are really bad, but otherwise I like it. Almost love it

though I am not sure if its for game development
Replies: >>715900496
Anonymous
7/19/2025, 8:18:41 PM No.715900247
>>715865647 (OP)
It's been around for forty years with it being the first language of many and other languages built from it.
Anonymous
7/19/2025, 8:20:26 PM No.715900396
>>715867095
>no classes and inheritance
>no templates
>no RAII
>no generics or function overloading
>the disgusting garbage that are c strings
die die die die die
Replies: >>715900608 >>715900774 >>715901239
Anonymous
7/19/2025, 8:21:56 PM No.715900496
>>715899804
It can't be worse than C/C++ compile times. Right .... right?
Replies: >>715900646
Anonymous
7/19/2025, 8:22:50 PM No.715900569
I underestimated how hard coding was, holy fuck. Toby Fox is inhuman for how he did it by himself.
Replies: >>715900626 >>715900668 >>715900770 >>715901774 >>715908585
Anonymous
7/19/2025, 8:23:06 PM No.715900587
>>715867095
for me, it is c++ and sfml autism
Anonymous
7/19/2025, 8:23:23 PM No.715900608
>>715900396
>>no classes and inheritance
>>no templates
>>no RAII
>>no generics or function overloading
Good
>>the disgusting garbage that are c strings
Fair point
Replies: >>715901239
Anonymous
7/19/2025, 8:23:48 PM No.715900626
>>715900569
Toby can't code for shit either lol
Replies: >>715908585
Anonymous
7/19/2025, 8:24:08 PM No.715900646
>>715900496
lets just say when anki switched to using rust in its code and I compile it on arch...it seriously takes like 8 minutes to compile it
Anonymous
7/19/2025, 8:24:25 PM No.715900668
>>715900569
Robert Fucks used Gamemaker
Much easier than coding it all yourself
Replies: >>715900786 >>715908585
Anonymous
7/19/2025, 8:25:55 PM No.715900751
>>715869626
game? nah, I wrote an HMI application at work. They sell it for BigMoney™
Anonymous
7/19/2025, 8:26:13 PM No.715900770
>>715900569
Don't worry. It'll click, eventually.
Anonymous
7/19/2025, 8:26:16 PM No.715900774
>>715900396
>the disgusting garbage that are c strings
what do you mean
c strings are perfect
just an array of char, nothing more, and it shouldn't be anything more than that
Anonymous
7/19/2025, 8:26:28 PM No.715900786
>>715900668
Gamemaker still needs a lot of coding to make anything decent tho. It's not like RPGMaker where there really is no coding, it's just drag and drop assets which anyone could do.
Anonymous
7/19/2025, 8:28:01 PM No.715900896
>>715891753
You can use CRTP to get rid of virtuals any time you know the type at compile time. Free abstraction for the same inline performance.
Anonymous
7/19/2025, 8:29:21 PM No.715900986
>>715867095
this, with OpenGL
Anonymous
7/19/2025, 8:29:30 PM No.715901001
>>715898909
Which C++ bloat features are actually good?
Replies: >>715901361 >>715901367 >>715901727
Anonymous
7/19/2025, 8:29:51 PM No.715901025
>>715889542
Memory leaks aren't even prevented by Rust. In fact, memory leaks are impossible to prevent in any Turing-complete language. It's mathematically provable.
Anonymous
7/19/2025, 8:31:18 PM No.715901134
>>715880786
In large overly complex systems you do need a language that doesn't break at all though, otherwise you get python which breaks everything in every update.
This is one of those things where different languages actually have different purposes.
Anonymous
7/19/2025, 8:32:43 PM No.715901239
1524937787771
1524937787771
md5: cf79a8decf73c036ca0aa02dd6b2e21a🔍
>>715900396
>>715900608
As someone who started learning C recently I find C strings quite curious. That's such a clusterfucky hacky pants on head retarded yet such elegant implementation, I can't even be mad.
Replies: >>715901416 >>715901448 >>715901669
Anonymous
7/19/2025, 8:34:22 PM No.715901361
>>715901001
They're mostly all good if you're aware of how they work under the hood.
Anonymous
7/19/2025, 8:34:28 PM No.715901367
>>715901001
i think there are a lot of good improvements C++ has over C, which arent bloat, such as raii (ignoring the implications of all the C++ value semantics that came with it), but one admittedly bloaty feature which is really nice are std strings
Replies: >>715901872
Anonymous
7/19/2025, 8:35:04 PM No.715901416
>>715901239
>make overloaded function that can either take a std::string or an int
>call it with foo ("test");
>int version gets called cause char[] is closer to int than to string
Anonymous
7/19/2025, 8:35:33 PM No.715901448
>>715901239
>elegant
strnggrtngmnscnnyhitlerhimmlerfggt_s("nigger", "tongue", len + 1 + forgot_the_fucking_terminator);
Replies: >>715901734 >>715901964
Anonymous
7/19/2025, 8:37:37 PM No.715901601
>>715865647 (OP)
It's taught at Universities in introductory classes. I understand that it's due to it being c-styled and object oriented. Apparently, C does not have function and operator overloading.
Anonymous
7/19/2025, 8:38:32 PM No.715901669
welsh-or-c-standard-library-function-3790885869
welsh-or-c-standard-library-function-3790885869
md5: f17ec841ff4d96707985766a493f562d🔍
>>715901239
Replies: >>715901964
Anonymous
7/19/2025, 8:38:57 PM No.715901705
Just use function pointers
Anonymous
7/19/2025, 8:39:19 PM No.715901727
>>715901001
>bloat
did your favourite streamer tell you that?
Anonymous
7/19/2025, 8:39:23 PM No.715901734
1534784736999
1534784736999
md5: f4bc95d26a98fd5e864abaff36b2d6c0🔍
>>715901448
Heh. Not that kind of elegant, the kind that it fits everything that is happening in C so well.
Anonymous
7/19/2025, 8:39:48 PM No.715901768
I hate pointers
Replies: >>715902106
Anonymous
7/19/2025, 8:39:52 PM No.715901774
>>715900569
>decide to learn programming after years of putting it off
>turns out I overestimated how hard it would be
I'm just built different, I guess.
Replies: >>715902008
Anonymous
7/19/2025, 8:41:07 PM No.715901872
>>715901367
>raii good
>but this container that automatically handles text storage and common operations in a memory-safe manner (except operator[] and other fun surprises) is bad
Replies: >>715903286
Anonymous
7/19/2025, 8:41:56 PM No.715901923
>>715867826
>i dont know what any of this means but i'm going to argue about it
retard
Anonymous
7/19/2025, 8:42:27 PM No.715901964
>>715901448
>>715901669
And so far I don't like string.h as well. just write your own functions lmao
Anonymous
7/19/2025, 8:42:43 PM No.715901983
>C
char *data = malloc(size)
>C++
char *data = (char *)malloc(size)

why?? just auto cast void pointers wtf
Replies: >>715902167 >>715902291 >>715902454 >>715902629 >>715902635 >>715902718
Anonymous
7/19/2025, 8:43:08 PM No.715902008
>>715901774
Let's see your games then, smartguy.
Replies: >>715902449
Anonymous
7/19/2025, 8:43:57 PM No.715902076
>>715891753
>templates too take up too much computing time.
What? Templates are processed at compile time.
Anonymous
7/19/2025, 8:44:16 PM No.715902106
>>715901768
imagine pass data that larger than eight bites
Anonymous
7/19/2025, 8:44:47 PM No.715902149
>>715867224
the language itself is pretty standard
but the reason you use c++ is because you want really optimized code
and writing optimized code is difficult
there's a lot of little tricks you can use that aren't common to other languages to save a few clock cycles
and you WILL be asked about them during interviews
Anonymous
7/19/2025, 8:45:00 PM No.715902167
>>715901983
>what is type safety
Replies: >>715902402
Anonymous
7/19/2025, 8:45:12 PM No.715902184
>>715865647 (OP)
>What makes this particular language the cornerstone for developing videogames?
It's fast and has all the bells and whistles. It's pretty awful to use though.
Anonymous
7/19/2025, 8:45:16 PM No.715902190
Why should I ever need to use Malloc?
Replies: >>715902286 >>715902295 >>715902647 >>715902941
Anonymous
7/19/2025, 8:46:44 PM No.715902286
>>715902190
You can't put everything on the stack.
Anonymous
7/19/2025, 8:46:49 PM No.715902291
>>715901983
>ever using malloc
Replies: >>715902635
Anonymous
7/19/2025, 8:46:51 PM No.715902295
>>715902190
if you use C then you need it but in C++ dont bother and learn the modern type safety ways
Anonymous
7/19/2025, 8:47:57 PM No.715902402
>>715902167
yeah but with void pointers its basically expected youre gonna cast it manually to some type so its worth it for that convenience, and also now a lot of code that would work straight ported from c has to be combed through to fix all these
Replies: >>715902585
Anonymous
7/19/2025, 8:48:29 PM No.715902440
>>715867095
what if I also want a job?
Replies: >>715902530
Anonymous
7/19/2025, 8:48:37 PM No.715902449
>>715902008
I'm learning OpenGL. Give me a few months.
Anonymous
7/19/2025, 8:48:41 PM No.715902454
>>715901983
>I want a strongly typed language
>nooo not like this
Replies: >>715902634 >>715902827
Anonymous
7/19/2025, 8:49:44 PM No.715902530
>>715902440
You learn Java sir.
Or Rust ma'am (sir).
Anonymous
7/19/2025, 8:50:28 PM No.715902585
>>715902402
dont use void pointers. dont be stupid
Replies: >>715902827
Anonymous
7/19/2025, 8:51:00 PM No.715902629
>>715901983
std::unique_ptr<char[]> data{std::make_unique<char[]>(size)};
Anonymous
7/19/2025, 8:51:04 PM No.715902634
>>715902454
>strongly typed
Yeah man implicitly converting bool to int is very strongly typed
Replies: >>715902729
Anonymous
7/19/2025, 8:51:05 PM No.715902635
>>715901983
>not casting malloc's return value
heretic
>>715902291
lol babby
Anonymous
7/19/2025, 8:51:18 PM No.715902647
>>715902190
When you want to allocate memory?
Replies: >>715902748
Anonymous
7/19/2025, 8:52:21 PM No.715902718
1750250901966675
1750250901966675
md5: 46cb56aaff8730b05c23a8e347e4d04c🔍
>>715901983
std::string data;
Replies: >>715902787
Anonymous
7/19/2025, 8:52:31 PM No.715902729
>>715902634
>bool
No such thing.
Anonymous
7/19/2025, 8:52:39 PM No.715902748
>>715902647
retard
Replies: >>715902838
Anonymous
7/19/2025, 8:53:10 PM No.715902780
wallah
wallah
md5: 977765ba955f63de30e9604abc88dae0🔍
>>715884531
I like to use them to make my own macro function calls to static functions that I make or other libraries provide, e.g. spdlog. it's so simple and useful once you know how to do it, and it can be very useful for a 1 liner. here's an example of logging.h for the part of the backend of my project https://pokestonks.xyz
the logging macros are at the bottom. you can then call them with 1 parameter, or many parameters e.g. LOG_INFO("AAAA") or LOG_INFO("{}", "AAAA")
Replies: >>715903902
Anonymous
7/19/2025, 8:53:17 PM No.715902787
>>715902718
That wastes memory on storing the length
Replies: >>715902972 >>715910116
Anonymous
7/19/2025, 8:53:43 PM No.715902827
>>715902454
>>715902585
c and c++ type checking is basically the same expect for this one difference which has basically been proven to be a big nuisance and not worth it. has cost everyone more time than it's saved. anyone using void pointers is aware its unsafe just let them do it ffs just focus on the features youre adding dont make it barely c compatible just for this one check
Anonymous
7/19/2025, 8:53:49 PM No.715902838
108947274356
108947274356
md5: 279572e80ba89ffb9da3946a3ac1fadc🔍
>>715902748
>malloc
>memory allocate
>doesnt mean memory allocate
Replies: >>715902974 >>715903226
Anonymous
7/19/2025, 8:54:49 PM No.715902907
imagine not using smart pointers
>dude I'm such a LE EPIC hacker, I'm gonna make my codebase unmaintainable
Anonymous
7/19/2025, 8:55:10 PM No.715902941
>>715902190
To overload the new operator
Anonymous
7/19/2025, 8:55:31 PM No.715902972
>>715902787
You always need the size stored somewhere if you want to do anything with that data and not segfault. What do you think the "size" in malloc(size) is?
Replies: >>715903031
Anonymous
7/19/2025, 8:55:33 PM No.715902974
>>715902838
retard (2)
Anonymous
7/19/2025, 8:55:50 PM No.715902995
>>715872384
SDL's just better and with 3 they put more effort into documentation
Anonymous
7/19/2025, 8:56:11 PM No.715903017
What would the ideal programming language for making video games look like?
Replies: >>715903119 >>715903450
Anonymous
7/19/2025, 8:56:23 PM No.715903031
>>715902972
Already kept track of externally. Clearly, there is no need to duplicate it.
Replies: >>715903181
Anonymous
7/19/2025, 8:56:28 PM No.715903038
>>715865647 (OP)
high performance + powerful abstractions
there's no other language that gives you both of these
Anonymous
7/19/2025, 8:56:50 PM No.715903062
godot icon
godot icon
md5: 4e42718223fc2cd66678a1d5eca27e8a🔍
I don't understand why Godot repeated Gamemaker's mistake of needlessly introducing its own custom scripting language.
Replies: >>715903335 >>715903341
Anonymous
7/19/2025, 8:57:01 PM No.715903071
>>715867592
the funny irony of memory management, is C and C++ users vehemently reject GC, but eventually implement their own worse version, the more automated and sophisticated their memory management strategy becomes.
Replies: >>715903304
Anonymous
7/19/2025, 8:57:26 PM No.715903097
file
file
md5: a32c3e1d3468c667673642fc983d8d01🔍
I just think it looks nicer.
Replies: >>715903142 >>715903306 >>715905532 >>715906407
Anonymous
7/19/2025, 8:57:29 PM No.715903098
>>715871010
>Mike Acton was the lead engine dev for insomniac for over a decade and current tardwrangles unity engine.
Mike Acton was fired from Unity after 10 years working on their ECS system which is STILL half-baked
>Casey is the handmade hero guy who has inspired countless developers
Casey has LITERALLY never made a game, or a game engine
Anonymous
7/19/2025, 8:57:48 PM No.715903119
>>715903017
scratch because video games are for children
Anonymous
7/19/2025, 8:58:10 PM No.715903142
>>715903097
Both are bottom-tier because the font isn't monospace
Anonymous
7/19/2025, 8:58:43 PM No.715903181
>>715903031
Write a function that retrieves the size of malloc'd data from this "external" source.
Replies: >>715903256 >>715903985
Anonymous
7/19/2025, 8:59:09 PM No.715903226
>>715902838
It's just the local malloc schizo. He want you to use mmap and the windows equivalent even if your use case can be handled with a single malloc call and proper memory management.
Replies: >>715903389
Anonymous
7/19/2025, 8:59:30 PM No.715903256
>>715903181
Where did you attain the variable "size" from?
Replies: >>715903405
Anonymous
7/19/2025, 8:59:52 PM No.715903286
>>715901872
im saying its bloated, not that it's bad
Anonymous
7/19/2025, 9:00:05 PM No.715903304
>>715903071
RAII isn't a garbage collector thoughbeit
Replies: >>715903346 >>715903401
Anonymous
7/19/2025, 9:00:06 PM No.715903306
>>715903097
left is more readable when viewing nested code in a simple editor
Replies: >>715903446
Anonymous
7/19/2025, 9:00:07 PM No.715903307
>>715897893
The issue is that your everyday generic hidden vtables that C++ introduces trash the cache.
Anonymous
7/19/2025, 9:00:10 PM No.715903314
Here's what C looks like to a normal programmer
*auto const& *var = const& (*)(getValue(&input) const*;
Replies: >>715903578
Anonymous
7/19/2025, 9:00:27 PM No.715903335
>>715903062
https://docs.godotengine.org/en/stable/about/faq.html#what-is-gdscript-and-why-should-i-use-it
Anonymous
7/19/2025, 9:00:32 PM No.715903341
>>715903062
Does this shit have proper C# support yet?
Replies: >>715903547 >>715903558
Anonymous
7/19/2025, 9:00:34 PM No.715903346
>>715903304
It literally is
Anonymous
7/19/2025, 9:01:10 PM No.715903389
>>715903226
>malloc
>mmap
this is a c++ thread
Replies: >>715903509
Anonymous
7/19/2025, 9:01:20 PM No.715903401
>>715903304
Automatic reference counting is a form of garbage collection lad.
C++ users are just building their own ad-hoc GC every program they write.
Replies: >>715905684
Anonymous
7/19/2025, 9:01:23 PM No.715903405
>>715903256
Holy fuck you are a dumb fuck. You're saying that a std::string wastes memory keeping track of the data size, like using an external variable to track the size of malloc'd data doesn't itself use memory.
Replies: >>715903473
Anonymous
7/19/2025, 9:01:50 PM No.715903446
>>715903306
Not really, it's a question of what you're used to. You know that an if is a counterpart to a closing bracket so an if at the same indentation has the same effect when reading as an opening bracket would
Anonymous
7/19/2025, 9:01:54 PM No.715903450
>>715903017
I don't think there's one-size-fits-all solution for it, because you have the engine portion, the gameplay logic and data driven things (cutscenes etc). Engine side of things you might want to be performant and closer to the metal, but for writing cutscenes something quick and simple to iterate might be nicer.
So, C++ and lua is a fine combo, for example.
Anonymous
7/19/2025, 9:02:11 PM No.715903473
>>715903405
But the variable "size" already exists. There is no need to create anything.
Replies: >>715903592
Anonymous
7/19/2025, 9:02:33 PM No.715903509
>>715903389 -> >>715866945
Anonymous
7/19/2025, 9:03:02 PM No.715903547
>>715903341
It has better C# support than Unity. It's still treated as a second-class language that is only supported out of spite, however.
Anonymous
7/19/2025, 9:03:12 PM No.715903558
>>715903341
Yes, C# is full featured, has access to anything GDScript has. I'm making a 3D action game in C# and came across no road blocks at all.
Unless you're talking about web export support, that's still missing. But that's Microsoft's fault.
Anonymous
7/19/2025, 9:03:26 PM No.715903578
>>715903314
>var is a pointer to a reference to
I don't think you can add a star to auto
>function call mixed with function definition syntax
????
Anonymous
7/19/2025, 9:03:41 PM No.715903592
>>715903473
With a std::string you never need an external size variable at all.
Anonymous
7/19/2025, 9:04:42 PM No.715903681
>>715867224
>Is C++ really as difficult to learn as people make it out to be, or is it just all a meme?
Yes, it is difficult. Memory management filters a lot of people. If you just want to make games it's probably not the best place to start.
Replies: >>715903741 >>715903753
Anonymous
7/19/2025, 9:05:29 PM No.715903741
>>715903681
>Memory management filters a lot of people
no it doesn't
shitty pointer semantics is usually the thing about C that filters people
Anonymous
7/19/2025, 9:05:35 PM No.715903753
>>715903681
If I just want to recreate RPG Maker what should I use?
Replies: >>715903880 >>715903883 >>715903918 >>715903934 >>715903995
Anonymous
7/19/2025, 9:06:09 PM No.715903808
1675254050475642
1675254050475642
md5: 26ab9ac179ab0161c7375c3f92176a12🔍
>>715867224
im a software monkey at one of those big tech companies. I see all these hotshot cream of the crop engineers constantly make mistakes and cause problems when landing c++ code. I hate using it too.
Replies: >>715903859
Anonymous
7/19/2025, 9:06:51 PM No.715903859
>>715903808
That's called job security
Anonymous
7/19/2025, 9:07:07 PM No.715903880
>>715903753
For that you could use just about anything
Anonymous
7/19/2025, 9:07:08 PM No.715903883
>>715903753
C
Anonymous
7/19/2025, 9:07:23 PM No.715903902
wallah.cpp
wallah.cpp
md5: 83fd6d9907f73c4f6320a99903b1fbe9🔍
>>715902780
and logging.cpp to complete it
Replies: >>715903980 >>715904119
Anonymous
7/19/2025, 9:07:40 PM No.715903918
>>715903753
any language you want that has raylib bindings
https://github.com/raysan5/raylib/blob/master/BINDINGS.md
Anonymous
7/19/2025, 9:07:48 PM No.715903934
>>715903753
RPGMaker. Don't overcomplicate things - use the appropriate tool for the job.
Anonymous
7/19/2025, 9:08:22 PM No.715903980
>>715903902
i::fucking::love::c++::syntax
Anonymous
7/19/2025, 9:08:26 PM No.715903985
1743151079820
1743151079820
md5: 9866c412902d68913de54487e9009c98🔍
>>715903181
It's not portable, but you can do that.
Replies: >>715904271 >>715904729
Anonymous
7/19/2025, 9:08:33 PM No.715903995
>>715903753
>If I just want to recreate RPG Maker what should I use?
Unity.
Anonymous
7/19/2025, 9:09:55 PM No.715904119
>>715903902
>void set_log_filename(const std::string filename){
>void set_default_logger_name(const std::string& logger_name){
explain why one needs a ref
Replies: >>715904729
Anonymous
7/19/2025, 9:11:27 PM No.715904249
>>715879691
Trannies jumped on rust to take ownership of it, like Mozilla and mainstream linux. They want to re-write all software in rust and force it on people and cancel them if they refuse.
Anonymous
7/19/2025, 9:11:39 PM No.715904271
>>715903985
>It's not portable
So it's a hacky, non-performant work-around to using at most, 8 bytes of extra memory.
Replies: >>715904795
Anonymous
7/19/2025, 9:14:47 PM No.715904516
>heh you can't run it an an ENIAC? uhh not portable sweaty! ;)
why are cniles so obsessed with running on 9000000 obscure platforms
Replies: >>715904659
Anonymous
7/19/2025, 9:15:32 PM No.715904585
>>715879691
Horrible syntax, horrible compile times, horrible culture of "just pull in 80 libraries to do one thing", horrible borrow checker shit, makes everything more painful and to no real benefit beyond memes about memory safety. (that even the fields supposedly affected like embedded don't believe in)
No real interesting programs made by the people shilling it non-stop either. If they'd stop acting like activists and more like programmers and code some fucking programs it'd have a better rep.
Anonymous
7/19/2025, 9:16:23 PM No.715904659
>>715904516
Rust is becoming too powerful and they're running out of excuses. LLVM not being able to target niche long dead 8bits cpu is their last cope.
Replies: >>715904738
Anonymous
7/19/2025, 9:17:11 PM No.715904729
carbon
carbon
md5: 1df9958c6a9b8b42722fde8bdcc70fc3🔍
>>715903985
>>715904119
was gonna say this, if youre gonna copy values, you might as well make them plain value parameters, so that callers can choose to move them in the call (or otherwise copy), and you can then move the parameter into your value
Replies: >>715904985
Anonymous
7/19/2025, 9:17:17 PM No.715904738
>>715904659
>Rust is becoming too powerful
how are those compile times doing champ?
Replies: >>715905014
Anonymous
7/19/2025, 9:17:55 PM No.715904795
>>715904271
I'm not arguing that you should use it instead of storing size inside object, just pointing out that it's possible to do.
Replies: >>715904898
Anonymous
7/19/2025, 9:19:23 PM No.715904898
>>715904795
Fair enough. It is interesting that such a function exists.
Anonymous
7/19/2025, 9:20:33 PM No.715904985
>>715904729
oh I wasn't intending to slam anon, I genuinely wanted to know the reason for using const& on only one of them
Replies: >>715905021
Anonymous
7/19/2025, 9:20:54 PM No.715905014
>>715904738
>how are those compile times doing champ?9ụSegmentation fault (core dumped)
Replies: >>715905246
Anonymous
7/19/2025, 9:21:00 PM No.715905021
>>715904985
im not slamming either jus making a suggestion :-)
Anonymous
7/19/2025, 9:22:23 PM No.715905123
>>715865793
template<typename T> Woman* MakeWoman(T&& person) const { return reinterpret_cast<Woman*>(&person); }
Replies: >>715905248
Anonymous
7/19/2025, 9:23:16 PM No.715905182
>>715865793
literally rent free
Anonymous
7/19/2025, 9:24:00 PM No.715905246
>>715905014
Yeah i don't use C shit either
Anonymous
7/19/2025, 9:24:01 PM No.715905248
>>715905123
where's the IsWoman constraint
Replies: >>715905445 >>715905729
Anonymous
7/19/2025, 9:25:22 PM No.715905351
>>715868968
SFINAE is not hacky at all what the fuck. It’s literally a compile time check to ensure a generic function only operates on a some allowed subset of generics, and with concepts from cpp17 or 20 I don’t remember where they got added now you even get sane compile time errors
Replies: >>715905472
Anonymous
7/19/2025, 9:26:30 PM No.715905445
>>715905248
You don’t need one. C++ is the most trans friendly language ever.
Anonymous
7/19/2025, 9:26:50 PM No.715905472
>>715905351
SFINAE is everything wrong with C++ in a nutshell
A whole rabbit hole of behaviour that comes from an unintended side effect of feature that was just hacked into the language, also has a name that makes no sense to people who don't inhabit the astral plane of autism
Replies: >>715905678
Anonymous
7/19/2025, 9:27:34 PM No.715905532
>>715903097
Left can claim to have 4 lines of code, which will impress idiots.
Anonymous
7/19/2025, 9:28:14 PM No.715905579
cute-cat-sunning-itself-happily-outdoors
cute-cat-sunning-itself-happily-outdoors
md5: d36409cf5fa8f9e7b43781b52a437d77🔍
I just use boost::shared_ptr and call functions and stuff
Replies: >>715905619
Anonymous
7/19/2025, 9:28:51 PM No.715905619
>>715905579
>C++ users HATE him
Anonymous
7/19/2025, 9:29:41 PM No.715905678
>>715905472
It’s not hacky and it’s not wrong. Generic functions don’t have to be fully generic, why would you think otherwise? Not only that but concepts and template argument interpretation is so deeply embedded in IDEs that you get warnings while you're working. You may want a template to operate on text-like data, why would you take a fully generic argument that accepts from ints to random objects? Add an SFINAE constraint via concepts and now you’ve got a typesafe constrained generic function. If you think SFINAE is bad maybe JavaScript is the language for you because it’s probably an IQ issue
Replies: >>715905815 >>715905843
Anonymous
7/19/2025, 9:29:45 PM No.715905684
>>715903401
The only reference-counting type in the C++ standard library I'm aware of is std::shared_ptr. It's not used very commonly, and everyone is well-aware of the performance impact. This is unlike Rust developers, who will happily wrap every object in Arc<T> because they don't know how their language works.

std::shared_ptr is not GC. I will explain the difference.
>std::shared_ptr
The object is reference counted. As soon as the reference count reaches 0, the object is destroyed at the point that its last reference goes out of scope.
In order to implement this, the program must check the reference count EVERY time a reference goes out of scope and it must conditionally perform the object destructor. This creates a significant performance hit due to the possibility of branch misprediction.

>GC
The object is reference counted. When the reference count reaches 0, no additional operations are performed. There is a separate thread called the garbage collector that regularly scans through a global database and destructs any object whose reference count reached 0.
The performance of GC is much better than std::shared_ptr because it doesn't inject a branch into the main program logic. The garbage collector has very little requirement of being performant, so generally, when there are a lot of objects with complicated destructors whose references regularly go out of scope, relegating this work to a dedicated garbage collector thread can greatly improve the performance of the main threads. Also, since there's only one garbage collector thread, there is no need to synchronise any resources that are accessed by the destructors, which could greatly simplify writing thread-safe programs.

So simple reference-counting is not GC. It's significantly worse in large and badly written applications. But it's better when it's applied in the correct contexts. Such as when you aren't writing code like a Java or Rust developer.
Replies: >>715906234 >>715906662
Anonymous
7/19/2025, 9:30:11 PM No.715905725
>>715867245
This is exactly how you use C++. You use its C++ to navigate the AIDS parts of C classic, and you use its C parts to circumvent the C++ bullshit.
Anonymous
7/19/2025, 9:30:15 PM No.715905729
>>715905248
bool Person::IsWoman() const { return chromosomes.sex[0] == "X" && chromosomes.sex[1] == "X"; }
Replies: >>715905882
Anonymous
7/19/2025, 9:31:12 PM No.715905815
>>715905678
It is hacky, it's hacky language design, it results in very complex side effects and it makes compile times much slower
Replies: >>715905990
Anonymous
7/19/2025, 9:31:40 PM No.715905843
>>715905678
JS causes constant screeching by low IQ footguns. You should have used Python which takes you by the gloved hand to lead you to your goal like a babby.
Replies: >>715906137
Anonymous
7/19/2025, 9:32:06 PM No.715905882
>>715905729
>using an array with strings for something you know only ever has two entries with 2 possible values
Replies: >>715906307
Anonymous
7/19/2025, 9:33:26 PM No.715905990
>>715905815
Sure it does make compile times larger, and yet, I’m working on a MLoC code base and through incremental compiling it’s barely noticeable. Saying they’re slow is literally an internet meme repeated by people who don’t use it in practice.
And it’s not hacky. The side effect is that literally just the right types will be accepted as arguments.
Replies: >>715906135
Anonymous
7/19/2025, 9:33:30 PM No.715905994
1401407327495
1401407327495
md5: cdc30ab9811081c4829695324041448f🔍
what all those self professed coding gurus itt have in common:
>0 github repos
>0 commits or pull requests
>0 minutes worked as a software engineer in any industry or position
>0 education
>0 projects bigger than 100 lines written
>0 games or software released
Anonymous
7/19/2025, 9:35:30 PM No.715906135
>>715905990
>The side effect is that literally just the right types will be accepted as arguments.
And the right type is deduced by instantiating the entire template and seeing if it fits or not
So to see what template is actually being instantiated you have to have a mental model of the entire function and the type being used as a template parameter
The right type should be specifed at the template parameter definition via a constraint
Replies: >>715906395
Anonymous
7/19/2025, 9:35:33 PM No.715906137
>>715905843
Oh but my problem isn’t with JavaScript. It’s with JavaScript programmers. JS is an amazingly performant language that requires millions of work hours by extremely intelligent people to squeeze performance out of what was a toy language. My problem isn’t with JS is with the average JS programmer which is very different.
Anonymous
7/19/2025, 9:36:41 PM No.715906234
>>715905684
anon all those words were just discussing how the GC strategies differ, not how one isn't GC.
Anyway, beyond shared_ptr, you also have std::unique_ptr, which is another GC strategy primitive.
Replies: >>715906317
Anonymous
7/19/2025, 9:37:32 PM No.715906307
>>715905882
I was considering simply writing X without quotations to imply use of enums, but I didn't think it would be clear enough. I guess if it was an enum class they'd be namespaced as something like SexChromosome::X but I thought that would be needlessly verbose. I was just making a silly joke pls no bully. Also technically there can possibly be more than two sex chromosomes with rare genetic conditions (klinefelter syndrome, triple x syndrome, etc.)
Replies: >>715906360
Anonymous
7/19/2025, 9:37:40 PM No.715906317
>>715906234
some people think GC only means "mark and sweep deferred collection"
Replies: >>715906436
Anonymous
7/19/2025, 9:38:14 PM No.715906360
>>715906307
those are undefined behavior
Replies: >>715906396
Anonymous
7/19/2025, 9:38:42 PM No.715906395
>>715906135
I can accept that sometimes if you’ve got a family of related generic functions it can be complex, but I can’t imagine an example of how it would be as confusing as you’re making out to be.
Replies: >>715906503
Anonymous
7/19/2025, 9:38:42 PM No.715906396
>>715906360
kek
Anonymous
7/19/2025, 9:38:48 PM No.715906407
Безымянный
Безымянный
md5: 2a12f1e2feecae4bc5cf89ed180dfb17🔍
>>715903097
Replies: >>715911054
Anonymous
7/19/2025, 9:39:09 PM No.715906436
>>715906317
yep, that's the problem.
C++ users need heavy reeducation, so we can start building better ones and leave the manual meme behind us for good.
Anonymous
7/19/2025, 9:39:53 PM No.715906482
> The object is reference counted. As soon as the reference count reaches 0, the object is destroyed at the point that its last reference goes out of scope.
> In order to implement this, the program must check the reference count EVERY time a reference goes out of scope and it must conditionally perform the object destructor. This creates a significant performance hit due to the possibility of branch misprediction.

def one of the tradeoffs of making EVERYTHING scope-based RAII, its obviously convenient but when you have 10 different destructors doin random shit when some object leaves scope it's going all over the place and the CPU wastes more time on these things than if it were scheduled better. RAII is good but it needs some more intentional usage
Replies: >>715906662 >>715907135
Anonymous
7/19/2025, 9:40:09 PM No.715906503
>>715906395
It's like saying that land mines are ok so long as you don't step on them
Yes you can avoid the complexity of SFINAE
But some people don't, some people use it to do crazy shit, and it's something that shouldn't even be there in the first place
Replies: >>715906612 >>715906621
Anonymous
7/19/2025, 9:41:29 PM No.715906612
>>715906503
>something that shouldn't even be there in the first place
What if you get invaded and have to hold a static position? A system of trenches, pre-sighted artillery, drones, and SFINAE is amazing for that scenario
Anonymous
7/19/2025, 9:41:34 PM No.715906621
>>715906503
What is your proposed solution? The only thing I find disgusting about C++ is the retarded std::visit stuff
Replies: >>715906709
Anonymous
7/19/2025, 9:41:55 PM No.715906662
>>715906482
oops forgot to reply to >>715905684
Anonymous
7/19/2025, 9:42:30 PM No.715906709
>>715906621
I just said it, template parameter constraints
Which I believe are being introduced to C++ now but they really should have been there from the start
Replies: >>715906835
Anonymous
7/19/2025, 9:44:05 PM No.715906835
>>715906709
Are you talking about concepts and requires? That is quite literally what I was talking about when talking about SFINAE. Are you talking about pre cpp20 SFINAE or something?
Replies: >>715906871
Anonymous
7/19/2025, 9:44:33 PM No.715906871
>>715906835
I have no idea what concepts are in relation to C++
Replies: >>715906914 >>715906959 >>715906982
Anonymous
7/19/2025, 9:45:06 PM No.715906914
>>715906871
Right. I figured as much
Replies: >>715906995
Anonymous
7/19/2025, 9:45:39 PM No.715906959
>>715906871
Not that anon but they're template parameter constraints
https://en.cppreference.com/w/cpp/language/constraints.html
Anonymous
7/19/2025, 9:46:03 PM No.715906982
>>715906871
custom templates with constraints (C++ users are discovering contract programming)
Anonymous
7/19/2025, 9:46:15 PM No.715906995
>>715906914
Saying "C++20 fixes this" is no justification for 20 years of bad language design, and because they never break backwards compability it's always going to be in the language
Replies: >>715907052 >>715907139
Anonymous
7/19/2025, 9:47:05 PM No.715907052
>>715906995
>20 years
Anon...
Replies: >>715907110
Anonymous
7/19/2025, 9:47:48 PM No.715907110
>>715907052
How long have templates been in C++?
Replies: >>715907132 >>715907251
Anonymous
7/19/2025, 9:48:08 PM No.715907132
>>715907110
closer to 40 than 20...
Anonymous
7/19/2025, 9:48:10 PM No.715907135
>>715906482
>In order to implement this, the program must check the reference count EVERY time a reference goes out of scope and it must conditionally perform the object destructor. This creates a significant performance hit due to the possibility of branch misprediction.
see this shit, children? see this? that's exactly the kind snake oil you should avoid. because of this and similar retardation many beginners will avoid using shared ptr because they are "slow". without ever saying what it means and in what context.
this is called micro optimizations and should be avoided. when a shared ptr becomes the bottleneck, and you can only know this when micro benching your code, then yes you can use something else. but the chance is that you will never ever write anything performance critical that this would pose a problem.
Replies: >>715907226 >>715907286
Anonymous
7/19/2025, 9:48:13 PM No.715907139
>>715906995
dw cpp2 is on the way!
Anonymous
7/19/2025, 9:48:27 PM No.715907156
>>715865647 (OP)
30 years of support for low-level libraries and APIs makes it the go-to for writing the rendering/input layer of video games.

Most game logic is done in higher level scripting language nowadays.
Anonymous
7/19/2025, 9:49:18 PM No.715907226
>>715907135
You can't micro bench shared pointers because adjusting the reference count is something that happens everywhere a shared pointer is used
Replies: >>715907527
Anonymous
7/19/2025, 9:49:44 PM No.715907251
>>715907110
35 years or something
Anonymous
7/19/2025, 9:50:11 PM No.715907286
>>715907135
>but the chance is that you will never ever write anything performance critical that this would pose a problem
c++ is used for video games which have a soft deadline of 5-16ms for simulating and rendering the game, i would say it warrants considering
Replies: >>715907383 >>715911243
Anonymous
7/19/2025, 9:51:18 PM No.715907383
>>715907286
Just turn on DLSS
Anonymous
7/19/2025, 9:51:59 PM No.715907431
C++ is a shit game scripting language due to compile times. You want iteration to be as fast as possible, which is why interpreted languages are better.
Replies: >>715907504 >>715907539
Anonymous
7/19/2025, 9:52:09 PM No.715907447
>>715895818
OOP has kind of fallen out of favor in vidya. These days its all about Components.
It's a little more flexible than OOP.
Good for situations like if you need two very different objects to perform the same functions. Like in an RTS you have a tower and an archer and you want both of them to shoot arrows.
Replies: >>715907489 >>715907541 >>715907551
Anonymous
7/19/2025, 9:52:47 PM No.715907489
>>715907447
Components are not an alternative to OOP
Anonymous
7/19/2025, 9:52:49 PM No.715907494
>>715891030
interesting. you sound just like my coding teacher in college. guess i'll dust off these decade of rust
Anonymous
7/19/2025, 9:52:58 PM No.715907504
>>715907431
> interpreted languages are better.
Ask Godot users how much they love GDS lol
Anonymous
7/19/2025, 9:53:16 PM No.715907527
>>715907226
of course you can because you must do an ungodly amount of copying shared ptrs in some critical section to ever reach a measurable impact from a couple atomic operations
Replies: >>715907590
Anonymous
7/19/2025, 9:53:28 PM No.715907539
>>715907431
>he doesn't know about hot reloading
Sub-second segfaults, can your stinky interpreted (((language))) do that?
Anonymous
7/19/2025, 9:53:30 PM No.715907541
>>715907447
99% of games are still using OOP and having components doesnt make something not OOP
Anonymous
7/19/2025, 9:53:39 PM No.715907551
>>715907447
I really don’t think you know what you’re talking about, sorry to be so blunt but you couldn’t possibly name a list of popular games using ECS. Components as used in games are more like a strategy pattern which is a pillar of vanilla OOP
Anonymous
7/19/2025, 9:53:54 PM No.715907578
why isn't it called ++C, pre increment is more efficient
Anonymous
7/19/2025, 9:54:02 PM No.715907590
>>715907527
Changing a reference every time you access a pointer has a significant performance cost
Replies: >>715907829 >>715908046
Anonymous
7/19/2025, 9:56:22 PM No.715907776
>>715867224
lol no, probably CSfags who think everything they do is high IQ
Replies: >>715908009
Anonymous
7/19/2025, 9:56:48 PM No.715907813
>>715867224
>Is C++ really as difficult to learn as people make it out to be, or is it just all a meme? I hear that it's confusing compared to regular C
I don't know where this myth comes from. Raw C is probably more difficult than C++ because you have to allocate memory yourself and rethink your abstractions because OOP is closer to how humans think about problems.

It's like carving a statue with a chainsaw vs a "smart" chainsaw that has a bunch of features that will help you but you couldn't possibly learn all of them.
Anonymous
7/19/2025, 9:56:58 PM No.715907829
>>715907590
>Changing a reference every time you access a pointer has a significant performance cost
what does that even mean, the shared ptr makes +1 when copied, -1 when destructed. it has 0 overhead when dereferencing .
Replies: >>715907971
Anonymous
7/19/2025, 9:57:41 PM No.715907883
Why are you arguing so fiercely about shared pointers? They’re supposed to be a niche kind of pointer not something you use all the time. Shared ownership is extremely flimsy. If you’re running into performance issues because you’ve got 10k shared pointers you’ve got a bigger issue, an architectural one
Unique pointers with raw pointers as observers if you need to pull data from somewhere else is usually the standard approach.
Replies: >>715907969 >>715907975 >>715908131
Anonymous
7/19/2025, 9:58:51 PM No.715907969
>>715907883
the point was originally how C++ users are sometimes unaware of the automatic memory solutions they use while bemoaning gc
Replies: >>715908056
Anonymous
7/19/2025, 9:58:55 PM No.715907971
>>715907829
that's what i meant
Replies: >>715908046 >>715908548
Anonymous
7/19/2025, 9:58:56 PM No.715907975
>>715907883
Even if you need to access a pointer, the standard approach is to do so as an observer (raw or weak) not as a shared owner. There’s minuscule cases where you can actually justify shared ownership.
Anonymous
7/19/2025, 9:59:20 PM No.715908009
>>715907776
Okay, have that guy explain what std::forward does
Replies: >>715908063 >>715908106
Anonymous
7/19/2025, 9:59:33 PM No.715908026
>>715879691
rust is getting shilled to me by my coworker who is constantly shilling some inane technology-of-the-month to everyone in the office so I know for a fact that it will be around for a few years and fade back into obscurity when the its userbase gets bored and moves onto the next piece of trash.
Anonymous
7/19/2025, 9:59:47 PM No.715908046
>>715907590
>>715907971
Show me the benchmarks in a real-world scenario. I promise you it's a nothingburger
Replies: >>715908159
Anonymous
7/19/2025, 9:59:57 PM No.715908056
>>715907969
Fair enough
Anonymous
7/19/2025, 10:00:01 PM No.715908063
>>715908009
forwards something as an rvalue or some shit
Anonymous
7/19/2025, 10:00:28 PM No.715908106
>>715908009
meant for >>715867224
Anonymous
7/19/2025, 10:00:48 PM No.715908131
>>715907883
>Unique pointers with raw pointers as observers
dont do that. it only needs 1 jeet that delete the dangling pointer
Replies: >>715908158 >>715908237 >>715908394
Anonymous
7/19/2025, 10:01:12 PM No.715908158
>>715908131
Anon, shared memory ownership is a far bigger can of worms.
Replies: >>715908208
Anonymous
7/19/2025, 10:01:12 PM No.715908159
>>715908046
yeah let me write a program of significant size that I can remove the shared ptrs from real quick
Anonymous
7/19/2025, 10:01:51 PM No.715908208
>>715908158
>Shared ownership is extremely flimsy
please explain
Replies: >>715908825 >>715909085
Anonymous
7/19/2025, 10:02:10 PM No.715908237
>>715908131
It's fine as long as the observers never leave scope of the owner.
Which they inevitably will.
Replies: >>715908825
Anonymous
7/19/2025, 10:04:03 PM No.715908394
>>715908131
Option Types would fix a lot of problems in C
Replies: >>715908441
Anonymous
7/19/2025, 10:04:37 PM No.715908441
>>715908394
option types dont solve that problem and option types are trivial to implement in C++
Replies: >>715908494 >>715908917
Anonymous
7/19/2025, 10:05:16 PM No.715908494
>>715908441
>implement
it's a standard library wrapper
Anonymous
7/19/2025, 10:05:45 PM No.715908548
>>715907971
if reference counting has a nontrivial performance impact on your software you're probably doing something wrong
Replies: >>715908618
Anonymous
7/19/2025, 10:06:12 PM No.715908585
doosex
doosex
md5: d6df056867ba89c5b154e4e1a89299f3🔍
>>715900569
>>715900626
>>715900668
Reminder that most video games are programmed like shit, and most developers who are actually making fun games aren't obsessing over code quality like a /g/ autist.
Replies: >>715908672 >>715908841 >>715909835
Anonymous
7/19/2025, 10:06:38 PM No.715908618
>>715908548
yes, that thing is using reference counting too much
Replies: >>715908706 >>715909025 >>715909297
Anonymous
7/19/2025, 10:07:13 PM No.715908672
>>715908585
If you think you posted an example of shit code you're a retard
Replies: >>715909056
Anonymous
7/19/2025, 10:07:37 PM No.715908706
>>715908618
it only does that when YOU copy or destroy it. it's all YOUR fault
Anonymous
7/19/2025, 10:08:57 PM No.715908825
>>715908208
It means you don’t understand the object’s lifetime.
>>715908237
This doesn’t solve the issue. It’s literally the same problem, if you need shared pointers or if you’ve got an architecture where an observer outlives the object’s lifetime, in both cases you’ve got the same problem, you don’t understand your own program. Shared pointers is like sweeping the rubbish under the bed.
It lets you hide the problem yes but you didn’t fix anything
Replies: >>715908860 >>715908951
Anonymous
7/19/2025, 10:09:07 PM No.715908841
1752955572103499
1752955572103499
md5: 32353f286057b6c86c4898f9b7305a70🔍
>>715908585
what is this language
Replies: >>715909056
Anonymous
7/19/2025, 10:09:28 PM No.715908860
>>715908825
>It means you don’t understand the object’s lifetime.
No it doesn't, it means it has a complex lifetime
Replies: >>715909302
Anonymous
7/19/2025, 10:10:13 PM No.715908917
>>715908441
they would because some(none) wouldn't crash your program like null does.
Replies: >>715908972
Anonymous
7/19/2025, 10:10:37 PM No.715908951
>>715908825
I dont think you ever wrote anything more substantial than hello world
Replies: >>715909302
Anonymous
7/19/2025, 10:10:53 PM No.715908972
>>715908917
you don't understand what you're talking about
Replies: >>715909086
Anonymous
7/19/2025, 10:11:17 PM No.715909009
>>715865647 (OP)
doesn't force you into a programming style.
Anonymous
7/19/2025, 10:11:28 PM No.715909025
>>715908618
What makes you think incrementing or decrementing a reference count when you create/destroy a pointer is non-negligible performance cost? Are you doing this hundreds of millions of times a second? Or are you scared of atomics or something?
Replies: >>715909080
Anonymous
7/19/2025, 10:11:49 PM No.715909056
>>715908672
>boolean galore for defining behaviors
It's not great, but there are worse examples in Deus Ex's code base. I just don't have a lot of other screenshots.
>>715908841
UEScript
Replies: >>715909114
Anonymous
7/19/2025, 10:12:08 PM No.715909080
>>715909025
>What makes you think incrementing or decrementing a reference count when you create/destroy a pointer is non-negligible performance cost?
I've been working on a language and I've been benchmarking the cost of different garbage collection schemes
Replies: >>715909167
Anonymous
7/19/2025, 10:12:18 PM No.715909085
>>715908208
For example, an object may outlive its ideal lifetime because it didn’t get cleaned up. RAII means an object will clean after itself, but only if it’s destroyed. If you’ve got shared ownership you may leave network or file handles open, leak memory, etc. You should know when objects need to be created and destroyed but shared ownership hides this.
They also allow for circular reference chains where the objects will never get cleaned up. It’s also a general code smell because again, if you can’t quickly and in a few words answer who owns this object then you don’t understand your program.
Replies: >>715909347
Anonymous
7/19/2025, 10:12:20 PM No.715909086
>>715908972
how am i wrong exactly?
Replies: >>715909161
Anonymous
7/19/2025, 10:12:39 PM No.715909114
>>715909056
>>boolean galore for defining behaviors
There is nothing wrong with this
Replies: >>715909576
Anonymous
7/19/2025, 10:12:49 PM No.715909127
>>715868042
>bloated mess
you only pay for what you use
Anonymous
7/19/2025, 10:13:10 PM No.715909161
>>715909086
an option type won't save you if it's pointing to something that got deleted somewhere else
Replies: >>715909395
Anonymous
7/19/2025, 10:13:13 PM No.715909167
>>715909080
Great! So you've benchmarked shared pointers vs raw pointers in a real-world scenario then?
Replies: >>715909196 >>715909758
Anonymous
7/19/2025, 10:13:40 PM No.715909196
>>715909167
yes
Replies: >>715909237
Anonymous
7/19/2025, 10:14:26 PM No.715909237
>>715909196
May I see the benchmarks?
Replies: >>715909293
Anonymous
7/19/2025, 10:15:10 PM No.715909293
>>715909237
I didn't save them
Anonymous
7/19/2025, 10:15:13 PM No.715909297
>>715908618
Commenting every like is fucking retarded.
Anonymous
7/19/2025, 10:15:15 PM No.715909302
>>715908860
Assuming the shared pointer is being used properly, yes. But anyone overusing them is simply enforcing a complex muddied lifetime because they don’t understand their own software.

>>715908951
On the contrary. Unique pointers are the standard anywhere there is large complexity. I’ve only ever seen shared pointers used as the norm in UI systems where several windows may own some resource. But everywhere else in the system the default is unique pointers. Shared pointers are amateurish and common on internet code bases written by redditors and students. Unique pointers are the default in any professional application outside or some systems like I mentioned with UIs
Replies: >>715910102
Anonymous
7/19/2025, 10:15:20 PM No.715909308
Benchmarking the performance of shared pointers vs raw pointers is impossible because they solve different problems
Replies: >>715909396
Anonymous
7/19/2025, 10:15:54 PM No.715909347
>>715909085
it's true that cpp doesnt stop you from doing stupid mistakes or misusing stuff. but cant see how any of your scenarios throw shade onto the shared ptr.
Replies: >>715909559
Anonymous
7/19/2025, 10:16:32 PM No.715909395
>>715909161
the entire point of them would be allowing safe handling of invalid pointers
>pointer isn't valid hence it's some(none)
Anonymous
7/19/2025, 10:16:32 PM No.715909396
>>715909308
You can simply turn all the shared pointers in your program into raw pointers and benchmark that
But again, meaningless result because it still depends on other things like what your program is actually doing
Replies: >>715909524
Anonymous
7/19/2025, 10:18:20 PM No.715909524
>>715909396
Anon, that would lead to objects outliving their lifetimes
I mean yeah, not destructing anything could improve performance on the short term, but eventually the program will crash
Replies: >>715909761
Anonymous
7/19/2025, 10:18:30 PM No.715909536
I wish there was a modern C++. Rust and Zig are VERY close but not quite there yet.
Replies: >>715909602 >>715909713
Anonymous
7/19/2025, 10:18:45 PM No.715909559
>>715909347
Cpp relies on RAII. RAII doesn’t work unless the object is destroyed. Objects aren’t destroyed if you overuse shared pointers and have ownership bugs.
Again, using shared pointers everywhere is simply wrong and not standard cpp. You need to know who owns which resource, understanding resource lifetime and ownership is the core of RAII. If you use shared pointers for no reason you're writing amateurish sloppy cpp.
Replies: >>715909974
Anonymous
7/19/2025, 10:18:57 PM No.715909576
>>715909114
>There is nothing wrong with this
You're retarded if you're still using booleans as properties for your classes. They should only be used as temporary variables that are calculated in functions.

It'd be better to use a strategy pattern for behaviors, and a list of what kind of gibs it leaves (blood, debris, etc)

But of course, this is a game that was actually released. And that's because people who get shit done don't care about scalability or code quality. They just get shit done the best way they know how to.
Replies: >>715909661 >>715909791 >>715909838
Anonymous
7/19/2025, 10:19:15 PM No.715909602
>>715909536
https://tour.dlang.org/
Replies: >>715909756
Anonymous
7/19/2025, 10:20:11 PM No.715909661
>>715909576
If you actually believe this, you should be able to explain why it's bad
Replies: >>715910228
Anonymous
7/19/2025, 10:20:15 PM No.715909671
Because it is used in Unity, which is an engine for people who actually develop (and finish) their games
Replies: >>715909719 >>715909724
Anonymous
7/19/2025, 10:20:58 PM No.715909713
>>715909536
Just write down your requirements in the English language and ask Claude to write it in x86SAM for optimal performance.
Anonymous
7/19/2025, 10:21:06 PM No.715909719
>>715909671
What? C++ is not used in Unity.
Replies: >>715909785
Anonymous
7/19/2025, 10:21:09 PM No.715909724
>>715909671
Anonette, unity uses c#.
Replies: >>715909785
Anonymous
7/19/2025, 10:21:30 PM No.715909756
>>715909602
>null values
roflmao
Replies: >>715909889
Anonymous
7/19/2025, 10:21:31 PM No.715909758
>>715909167
he doesn't because a real-world scenario would be a poor benchmark for comparing garbage collection strategies because memory management is only ever a meaningful variable if you've done something wrong. if the cost of copying a shared_ptr is expensive compared to whatever you're doing with the object the pointer is referencing you've fucked up.
Replies: >>715909880
Anonymous
7/19/2025, 10:21:34 PM No.715909761
>>715909524
>Anon, that would lead to objects outliving their lifetimes
so? it just means you waste some memory, that's fine for a benchmark
Replies: >>715909918
Anonymous
7/19/2025, 10:22:01 PM No.715909785
>>715909719
>>715909724
My bad thought OP was talking about C# for some reason lol
Anonymous
7/19/2025, 10:22:05 PM No.715909791
>>715909576
>It'd be better to use a strategy pattern for behaviors
Can you actually explain why?
Anonymous
7/19/2025, 10:22:43 PM No.715909835
>>715908585
As with most tech subjects, pure efficiency discussion pales in comparison getting the thing done. I've been a programmer for seven years making internal tools and backend tech for a consumer goods company, and efficiency is always just a background concern. "Code Quality" refers primarily towards readability, consistency, and maintainability.

Whether a game is programmed "Well" is not as important as whether you have a game at all and whether people like playing it.
Anonymous
7/19/2025, 10:22:45 PM No.715909838
>>715909576
>It'd be better to use a strategy pattern for behaviors, and a list of what kind of gibs it leaves (blood, debris, etc)
No that's not better you fucking retard, it requires way more code and it's much slower
Who tought you how to program?
Replies: >>715909907 >>715910357
Anonymous
7/19/2025, 10:23:18 PM No.715909880
>>715909758
>he doesn't because a real-world scenario would be a poor benchmark for comparing garbage collection strategies because memory management is only ever a meaningful variable if you've done something wrong
I have no idea what you're talking about, that's completely wrong
Anonymous
7/19/2025, 10:23:28 PM No.715909889
>>715909756
you're not going to avoid null unless you go into functional languages.
Replies: >>715910210
Anonymous
7/19/2025, 10:23:49 PM No.715909907
>>715909838
>Who tought you how to program?
the same person who tote you englishe
Anonymous
7/19/2025, 10:24:02 PM No.715909918
>>715909761
Resource freeing has a significant impact on performance. The benchmark isn't going to give you meaningful info if you don't include it.
Replies: >>715910004
Anonymous
7/19/2025, 10:24:59 PM No.715909974
>>715909559
>Cpp relies on RAII.
it does not. there is something called functional
Anonymous
7/19/2025, 10:25:22 PM No.715910004
>>715909918
The benchmark is simply the cost of reference counting vs not reference counting
Replies: >>715910049
Anonymous
7/19/2025, 10:26:13 PM No.715910049
>>715910004
No, the second scenario you're suggesting would also not free resources
Replies: >>715910084
Anonymous
7/19/2025, 10:26:42 PM No.715910084
>>715910049
I'm suggesting you don't free resources in either scenario and simply measure the difference between changing the reference counts vs not changing them
Replies: >>715910241 >>715910779
Anonymous
7/19/2025, 10:26:54 PM No.715910102
>>715909302
you make big claims, my nigga. smart pointers have 0 to do with complexity and calling shared ptrs "amateurish" just shows that in fact you are the amateur with strong opinions and 0 understanding.
Anonymous
7/19/2025, 10:27:12 PM No.715910116
>>715902787
technically all 3 C++ library implementations implement small string optimization, which means the string wont allocate memory if the string is below 15 letters long, which is arguably a more measurable performance improvement compared to removing a size (if it's able to be utilized).
but the real issue is that std::string will zero initialize the memory on resize (unless you use the weird C++20 allocator callback thing).
But this is also true for std::make_unique, if you use new[] instead it will leave the variables uninitialized.
([code]std::make_unique<char[]>(size)[/code] is equal to [code]new char[]()[/code], the () makes the value initialized with zero)
Anonymous
7/19/2025, 10:28:43 PM No.715910210
>>715909889
As if functional programming didn’t have the same problem.
>ackshually we don’t have null pointers ever because we wrap them in an option monad
And what do you do with the option type to use it? Check if it’s null. Now you never have nullptr issues but you have null wrapper issues. Kek
Replies: >>715910427 >>715910763
Anonymous
7/19/2025, 10:29:01 PM No.715910228
>>715909661
if (bBlood){
spawnBlood()
}
if(bDebris){
spawnDebris()
}
>hey anon we need some projectiles to spawn sonic waves upon impact, can you do that? K thanks
Sure, boss. Just let me write another bool and if statement.
>and hey, we need some projectiles to spawn blood, but ONLY if they're in a room with no gas
Oh, so ALL projectiles that spawn blood shouldn't spawn blood if they're in a gas room?
>No, this needs to be another property
Okay, will it effect the debris spawn if that flag is checked?
>No, but we might want conditional debris spawn later on.

Adding a bunch of booleans to your object means you have to track WHERE they're being used, is a violation of SOC (because why the hell should a projectile itself dictate whether or not blood spawns instead of the object hit by a projectile?), and adds complexity later down the road if your conditions need conditions.

But again: that's the difference between actual developers and programming autists who never get shit done.
Replies: >>715910394 >>715910428 >>715910686 >>715910760
Anonymous
7/19/2025, 10:29:03 PM No.715910229
>>715867095
The new gpu wrapper is pretty wicked, beats the fuck out of writing a vulkan rendered from scratch. Apparently the 2d api is getting shader support in 3.4 according to some rumours/git commits
Anonymous
7/19/2025, 10:29:15 PM No.715910241
>>715910084
>change reference count
>maybe reference count reaches 0
>maybe we free the resource
>it takes time
vs
>don't change reference count

This comparison is pointless
Replies: >>715910338 >>715910779
Anonymous
7/19/2025, 10:31:06 PM No.715910338
>>715910241
the difference between changing ref counts and not changing them is the difference between memory management using shared ptrs vs manual freeing or unique ptrs
Replies: >>715910779
Anonymous
7/19/2025, 10:31:34 PM No.715910357
>>715909838
>it requires way more code
Initial overhead is higher but the implementation means LESS code, more reusability of behaviors, and something more straightforward for designers to work with so they can leave the programming autists alone.
>and it's much slower
Are you gaming on a 8086 CPU?
Replies: >>715910527
Anonymous
7/19/2025, 10:32:11 PM No.715910394
>>715910228
You're inventing theoretical edge case scenarios that would make the pattern poor practice, but it means nothing because the scenario is made up
You could do this for literally everything, how you code things is based on how your game works and what you know it does and doesn't have to do
Replies: >>715910959
Anonymous
7/19/2025, 10:32:44 PM No.715910427
>>715910210
>you have null wrapper issues.
which would be what?
Alternatively, how do you have pointers (being able to do real things) without null at all?
Replies: >>715910645
Anonymous
7/19/2025, 10:32:47 PM No.715910428
>>715910228
>that's the difference between actual developers and programming autists who never get shit done.
You're critiquing the code of what is widely regarded as one of the best games of all time and you're somebody who hasn't made a game
Your criticisms are stupid and out of context
Replies: >>715910959
Anonymous
7/19/2025, 10:34:07 PM No.715910527
>>715910357
Designers don't work with code. The most straightfoward way of adding a condition to a projectile is to add another boolean. This game was made 25 years ago, but attaching fucking linked lists to projectiles is going to be slow even on a modern system
Replies: >>715910959
Anonymous
7/19/2025, 10:36:00 PM No.715910645
>>715910427
Data is data. Even without pointers some operation may fail or some thing may not be in the proper state. It’s not a pointer issue it’s a data validity issue. Maybe a in Haskell is no different from a pointer in the sense you still have to check if it’s valid. And functional langs can support pointers, see ocaml
Replies: >>715910785
Anonymous
7/19/2025, 10:36:47 PM No.715910686
>>715910228
>NOOOO YOU MUST FOLLOW THE CODECAMP RULES-AAAACK
Shut the fuck up retard, you have no idea what you're talking about and you've never had to make anything in a short period of time. If you've already thought out the game mechanics and design then making dozens of classes and abstractions you might not need just wastes time, effort, and makes it more complicated than it needs to.
Anonymous
7/19/2025, 10:37:52 PM No.715910760
>>715910228
Nta but I think you're getting into mixing data and logic territory. Your projectile data should use flyweight that's read from a file, and which in fact uses bools (or bitmask if you wanna bee a haxxor) for its behavior quirks.
Then the function that decides whether something (blood etc.) spawns uses both projectiles and environment (higher-level abstractions), which works fine.
Anonymous
7/19/2025, 10:38:07 PM No.715910763
>>715910210
>Now you never have nullptr issues but you have null wrapper issues
Which are caught at compile time.
Replies: >>715910874
Anonymous
7/19/2025, 10:38:21 PM No.715910779
>>715910241 (Me)
I can't read.

>>715910084
>>715910338
Unfortunately, resource freeing DOES NOT take a fixed amount of time due to the surrounding logic and hardware considerations.

To see the issue, compare two scenarios:
>we change reference count
>maybe it reaches 0
>maybe we free the resource
vs
>we change reference count
>it doesn't matter

In the first scenario, we need to implement a branch in the program logic to determine whether or not the destructor needs to be called. This can cause a very significant performance impact BEYOND just the cost of the destructor itself, since CPUs perform much better when executing branch-free code.
If we get to hand-pick when to free the resource, this branching cost can be avoided, or at least minimised by placing the free in a context where a performance hit is permissible. That additional cost isn't being included in the comparison you're suggesting, since neither scenarios that you suggest include a branch.
Replies: >>715910924
Anonymous
7/19/2025, 10:38:28 PM No.715910785
>>715910645
You're not making a coherent point.
null values are bad sure, but you didn't specify a concrete alternative.
>data validity issue.
is incredibly abstract and vague
Replies: >>715910945
Anonymous
7/19/2025, 10:39:04 PM No.715910831
Shared pointer users are not human.
Anonymous
7/19/2025, 10:39:41 PM No.715910874
>>715910763
How in the actual world is the compiler going to know if some web request will succeed or not? The only thing the compiler may enforce (depending on the language) is that you’re handling the case where data is invalid. Which is no different from making sure you’re checking every pointer which depending on the situation may border on the pedantic
Anonymous
7/19/2025, 10:40:21 PM No.715910916
cool thread as a nonprpgrammer i found it interesting, any good recommendations for resource/course to learn? i assume there's as much shitty advice out there as there is good
Replies: >>715912090
Anonymous
7/19/2025, 10:40:27 PM No.715910924
>>715910779
Yes you still add the check if needs to be freed check, you just don't free it if it passes
Replies: >>715911306
Anonymous
7/19/2025, 10:40:51 PM No.715910945
>>715910785
I’m not suggesting an alternative. As long as programs have side effects data validity will be a potential issue. I’m saying using a functional language won’t save you from that, which seems to be something I keep hearing people say (wrongly)
Replies: >>715911036
Anonymous
7/19/2025, 10:41:06 PM No.715910959
>>715910394
>You're inventing theoretical edge case scenarios
Almost like good programming patterns are for handling edge case scenarios and ever-changing requirements. Fucking poojeet lmao
>>715910428
I guess you have no reading comprehension skills. The point of the discussion is that most games worth playing are coded like shit.
> widely regarded as one of the best games of all time
Yeah and it's also one of the buggiest games of all time so make of that what you will.
>>715910527
Doesn't matter, you still need a low to no code implementation for creating dynamic assets and levels.
>This game was made 25 years ago, but attaching fucking linked lists to projectiles is going to be slow even on a modern system
You fucking retard. Do you really think iterating over a list of 2-3 behaviors when a projectile collides is going to do ANYTHING to performance?
You are actually retarded.
Replies: >>715911041 >>715911087 >>715911145
Anonymous
7/19/2025, 10:42:07 PM No.715911036
>>715910945
Something more productive then.
What IS a modern C++ successor to you then?
Replies: >>715911071 >>715911250
Anonymous
7/19/2025, 10:42:14 PM No.715911041
>>715910959
Storing a list in a projectile is going to be bad for performance
A bool flag is literally a low code solution, it's the lowest code solution there actually is
Replies: >>715911254
Anonymous
7/19/2025, 10:42:19 PM No.715911054
>>715906407
goto fail;
goto fail;
Anonymous
7/19/2025, 10:42:36 PM No.715911071
>>715911036
Java
Replies: >>715911314 >>715911446
Anonymous
7/19/2025, 10:42:49 PM No.715911087
>>715910959
>You fucking retard. Do you really think iterating over a list of 2-3 behaviors when a projectile collides is going to do ANYTHING to performance?
depends on the game, but then you're a no-coder so you wouldn't get it
Anonymous
7/19/2025, 10:43:34 PM No.715911145
>>715910959
>Almost like good programming patterns are for handling edge case scenarios and ever-changing requirements.
Programming patterns that overcomplicate and slow things down to accommodate for edge cases and changing requirements that YOU KNOW AREN'T GOING TO HAPPEN BECAUSE YOU ALREADY KNOW WHAT YOU'RE MAKING is poor programming practice. You wouldn't have lasted a fucking second back in the days where performance and efficient memory usage actually mattered, holy shit
Replies: >>715911360 >>715911865
Anonymous
7/19/2025, 10:44:43 PM No.715911243
>>715907286
>16ms
144Hz gamerchads did not like this
Anonymous
7/19/2025, 10:44:49 PM No.715911250
>>715911036
C# if you don’t mind some performance hit compared to cpp. It’s still fast unless you’re doing very demanding work
Anonymous
7/19/2025, 10:44:52 PM No.715911254
>>715911041
>Storing a list in a projectile is going to be bad for performance
Tell that to literally every AA/AAA game made since 2003.
>A bool flag is literally a low code solution, it's the lowest code solution there actually is
>SAAAAAARRRR
Replies: >>715911283
Anonymous
7/19/2025, 10:45:22 PM No.715911283
>>715911254
every AA/AAA game made since 2003 does not store linked lists in a projectile lil bro
Anonymous
7/19/2025, 10:45:43 PM No.715911306
>>715910924
That would only introduce a short jump, which CPUs perform much better than long jumps.
Also, if destructors are potentially called everywhere, then we either need to always keep the destructor code in CPU cache or to dynamically load it in every time to destruct, which is another performance hit in both cases.
And also, if we can destruct multiple similar objects in the same place, then their destructors will presumably access the same resources, so we yet again need to swap out the CPU cache less often.
Replies: >>715911450
Anonymous
7/19/2025, 10:45:50 PM No.715911314
>>715911071
Worse than C# as a language but it has a much better ecosystem for enterprise. Most people don’t need that at all.
Anonymous
7/19/2025, 10:46:20 PM No.715911351
in reality, you'd actually want to use bitarrays because they'd also simplify your networking
Anonymous
7/19/2025, 10:46:28 PM No.715911360
>>715911145
>overcomplicate
>my poojeet brain cannot understand abstractions and I must write if/else statements for all my logic
Be quiet YandereDev, you haven't been relevant in 10 years.
Replies: >>715911465
Anonymous
7/19/2025, 10:47:36 PM No.715911446
>>715911071
Java is more of a successor to COBOL than anything at this point.
Anonymous
7/19/2025, 10:47:39 PM No.715911450
>>715911306
No you can call to a remote function that just does nothing
You're trying really hard to make a point here but you don't have one
Replies: >>715911601
Anonymous
7/19/2025, 10:47:53 PM No.715911465
>>715911360
"Overcomplicate" as in making your program do more work than it has to.
Making an entire system to handle something that could have just been a boolean is peak midwit shitter programming.
Your nodev is showing
Replies: >>715911649 >>715911657
Anonymous
7/19/2025, 10:49:41 PM No.715911601
>>715911450
This does not address the second and third issue.
Replies: >>715911902
Anonymous
7/19/2025, 10:50:22 PM No.715911649
>>715911465
>that could have just been a boolean
It shouldn't be a boolean, because that couples unrelated behavior to the projectile.
Booleans should rarely if ever be properties on an object.
But you wouldn't know that because you're a retarded poojeet.
Replies: >>715911897
Anonymous
7/19/2025, 10:50:25 PM No.715911657
>>715911465
I’ve never seen one good opinion coming from anyone using internet meme words like that. And I’m pretty open minded to conflicting opinions if they can provide arguments for them. But I’ve never seen anyone speaking in memes be able to justify their ideas. People like you are like toddlers throwing a tantrum when they see something they don’t like
Replies: >>715912013
Anonymous
7/19/2025, 10:53:06 PM No.715911865
>>715911145
>changing requirements that YOU KNOW AREN'T GOING TO HAPPEN BECAUSE YOU ALREADY KNOW WHAT YOU'RE MAKING is poor programming practice.
You've never worked as a software developer
Anonymous
7/19/2025, 10:53:33 PM No.715911897
>>715911649
Good programmers understand that that these hard and fast rules should situationally be deviated from when it's simple and efficient and fits the case. Shit programmers treat them as law and don't even consider why they're a thing or when you could break them while still having proper code.
Replies: >>715912138
Anonymous
7/19/2025, 10:53:37 PM No.715911902
>>715911601
destructors do not access the same resources, they're freeing different pieces of memory
like I said, you're reaching to try and make a point that you haven't thought through
Replies: >>715912065
Anonymous
7/19/2025, 10:55:21 PM No.715912013
>>715911657
So are you actually going to refute anything I said or
Replies: >>715912094
Anonymous
7/19/2025, 10:56:00 PM No.715912065
>>715911902
The heap allocator is a resource. Destructors may also make 3rd party API calls in some cases, and who knows what they're accessing then.
Replies: >>715912183
Anonymous
7/19/2025, 10:56:24 PM No.715912090
>>715910916
Read a book, >>715867095 for C or C++ programming principles and practices, or if you want something casual (but still practical), python crash course.
Anonymous
7/19/2025, 10:56:26 PM No.715912094
>>715912013
You don’t refute a tantrum.
Replies: >>715912120
Anonymous
7/19/2025, 10:56:49 PM No.715912120
>>715912094
I accept your concession!
Anonymous
7/19/2025, 10:57:00 PM No.715912138
>>715911897
so you think projectile reactions should reside as booleans within the projectile? Not even handled by the object it's reacting to? Or even encapsulated in some kind of reusable behavior that other objects can use? What kind of niggerbrained solution is that?
Replies: >>715912229
Anonymous
7/19/2025, 10:57:45 PM No.715912183
>>715912065
The cost of freeing memory is fairly consistent and it doesn't really matter when you're freeing it in relation to other free calls
Replies: >>715912383
Anonymous
7/19/2025, 10:58:22 PM No.715912229
>>715912138
In an extremely minimalistic case like this, that's fine, yeah. Slapping a fucking linked list onto every projectile when that functionality is totally pointless is poor practice.
Anonymous
7/19/2025, 11:00:28 PM No.715912383
>>715912183
Unless you don't use the standard allocator.
Replies: >>715912449
Anonymous
7/19/2025, 11:01:13 PM No.715912449
>>715912383
Yes, if you use a custom allocator it's even more consistent because you know exactly what's happening