← Home ← Back to /v/

Thread 715865647

555 posts 100 images /v/
Anonymous No.715865647 >>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
What makes this particular language the cornerstone for developing videogames?
Anonymous No.715865793 >>715879838 >>715898751 >>715905123 >>715905182
>>715865647 (OP)
doesn't support user defined genders
Anonymous No.715865802
cheap high-level abstractions
Anonymous No.715866818
>>715865647 (OP)
its good
Anonymous No.715866945 >>715878297 >>715903509
>>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
Anonymous No.715867095 >>715867148 >>715867289 >>715868178 >>715869626 >>715882459 >>715892990 >>715895859 >>715900396 >>715900587 >>715900986 >>715902440 >>715910229 >>715912090
This + SDL is all you'll ever need
Anonymous No.715867148
>>715867095
raylib is better
Anonymous No.715867224 >>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
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
Anonymous No.715867240
*implicitly converts ur object*
Anonymous No.715867245 >>715867356 >>715870538 >>715878535 >>715891753 >>715905725
>>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.
Anonymous No.715867289
>>715867095
Agreed.
Anonymous 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 No.715867356 >>715867425 >>715891753
>>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?
Anonymous No.715867425 >>715870635
>>715867356
I got it from Casey Muratori and Mike Acton.
Anonymous No.715867532 >>715867592 >>715867826 >>715871041
>>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).
Anonymous No.715867592 >>715867960 >>715903071
>>715867532
>automatic garbage collection leads to a more efficient system
Anonymous 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 No.715867826 >>715901923
>>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.
Anonymous No.715867864
>>715865647 (OP)
You can't go with python for good performance in a resource-intensive AAA game.
Anonymous No.715867960 >>715868084
>>715867592
>ignores the further clause still determining what anon meant here
>failing at English grammar
OK jeet
Anonymous No.715868042 >>715877950 >>715878535 >>715890068 >>715909127
>>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.
Anonymous 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 No.715868178
>>715867095
Sure, but I prefer C+++SDL.
Anonymous No.715868221 >>715868289
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.
Anonymous No.715868289 >>715868398 >>715868461
>>715868221
Stop calling it "coding games" and "coding languages".
It's programming.
I'm sick of this faggot zoomer "coder" nonsense.
Anonymous No.715868398 >>715868439
>>715868289
Brits have always called it "coding" since the 70s/80s. Go watch some BBC specials about the rise of the microcomputers.
Anonymous No.715868428 >>715872147 >>715878535
>>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++
Anonymous No.715868439 >>715881925
>>715868398
Then brits have been faggots since the 70s
Anonymous 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 No.715868968 >>715905351
>>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).
Anonymous No.715869009 >>715869069
>>715865647 (OP)
Do I have to learn Hindi before learning C++
Anonymous No.715869069
>>715869009
Only for Java.
Anonymous No.715869571 >>715870673 >>715898389
how come there wasn't a single de/v/ thread for the past week?
Anonymous No.715869626 >>715900751
>>715867095
If that's the case, then post the games you've made with that combo.
Anonymous No.715870017 >>715878535
>>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.
Anonymous 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 No.715870538
>>715867245
>A lot of C++ "features" like the STL are totally ignored, for instance.
grim
Anonymous No.715870635 >>715871010
>>715867425
Ah so you learned it from grifters and clowns.
Anonymous No.715870673
>>715869571
it's over
Anonymous No.715870779 >>715870973
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.
Anonymous No.715870973 >>715871023 >>715877567
>>715870779
Java has all of that but with proper reflection
Anonymous No.715871010 >>715872147 >>715903098
>>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.
Anonymous No.715871023 >>715871076
>>715870973
It also has dogshit performance because of the JVM.
Anonymous 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 No.715871076 >>715871118 >>715871125 >>715871306 >>715872106
>>715871023
You aren't programming embedded systems where you need 2ms response times
>b-but
No, you're not
Anonymous No.715871118 >>715871378 >>715871520
>>715871076
Look at what board you're on.
Performance optimization matters for games.
Anonymous No.715871125
>>715871076
So what?
Anonymous No.715871306 >>715871378 >>715871520
>>715871076
all game logic and rendering needs to fit within a 16ms window per frame to hit 60fps, so you’re retarded
Anonymous No.715871378 >>715871458 >>715871475 >>715877165
>>715871306
>>715871118
Anonymous No.715871458
>>715871378
Minecraft is notorious for its garbage performance due to it being written in Java.
Anonymous No.715871475
>>715871378
yeah, don’t expect to make anything more graphically interesting or complicated than minecraft in java
Anonymous No.715871520 >>715872194
>>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.
Anonymous No.715871634 >>715871707
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.
Anonymous No.715871707 >>715871864
>>715871634
I was with you until your obsessions shone through.
Anonymous No.715871864 >>715871927
>>715871707
>obsession is when thing is thrown in your face every day of every week and you notice it
Anonymous No.715871927 >>715871982
>>715871864
You're the first one to bring that shit up in this thread. Kill yourself.
Anonymous No.715871982
>>715871927
there's literally a blahaj thread right now
Anonymous No.715872106 >>715872178
>>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.
Anonymous No.715872147 >>715878535
>>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.
Anonymous No.715872178 >>715877482 >>715894847
>>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
Anonymous No.715872194 >>715877341
>>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.
Anonymous No.715872289
>everyone on /v/ knows how to code
>0 finished projects
curious
Anonymous No.715872384 >>715872420 >>715872535 >>715872579 >>715872703 >>715873592 >>715895036 >>715902995
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.
Anonymous No.715872420 >>715872535
>>715872384
>combing
*combining
not sure what happened there. I'm on desktop, so it's not autocorrect.
Anonymous No.715872458
low-level, organized, fast, powerful, and is still the best language for software development
Anonymous 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 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 No.715872703
>>715872384
The the version of SDL that has the most compatibility with everything.
Anonymous 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 No.715874272
>>715865647 (OP)
It runs on everything, has lots of features, there's plenty of documentation, and it's cheap computationally
Anonymous 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 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 No.715876973 >>715877743
>>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
Anonymous No.715877087 >>715877389 >>715877727
>>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.
Anonymous 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 No.715877280 >>715877321 >>715877472 >>715878535
>>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.
Anonymous No.715877321 >>715877363
>>715877280
That exists, it's called C#
Anonymous 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 No.715877363
>>715877321
Are you retarded?
Anonymous 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 No.715877472 >>715877621 >>715877631
>>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.
Anonymous 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 No.715877567
>>715870973
Java does not have multiple inheritance of classes, only interfaces.
Anonymous No.715877621 >>715890190 >>715891237 >>715896626
>>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.
Anonymous 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 No.715877727 >>715877849 >>715878182
>>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
Anonymous No.715877743 >>715877926
>>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.
Anonymous 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 No.715877926 >>715878415
>>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.
Anonymous 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 No.715878109 >>715897290
>>715867224
Yeah it's pretty hard. C++ is not for fun and you need to know how your code will compile.
Anonymous 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 No.715878218 >>715887026
>>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.
Anonymous No.715878297 >>715898392
>>715866945
C fags are so pathetic and always failed cpp beginners
Anonymous 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 No.715878535 >>715879689 >>715890068
>>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
Anonymous No.715879689
>>715878535
talk big eat a fig n00b
Anonymous No.715879691 >>715880351 >>715880541 >>715882021 >>715889542 >>715890272 >>715897145 >>715899804 >>715904249 >>715904585 >>715908026
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/
Anonymous No.715879838
>>715865793
Go back to /gpol/
Anonymous No.715880267
Anonymous No.715880351
>>715879691
>15 years old language just needs 2 more weeks to mature
it's basically too old for its average user taste already
Anonymous No.715880541 >>715881367
>>715879691
one compiler, depends on Visual Studio, no hardware backwards compatibility, community full of rabid pedo-trannies, memory safety is a myth
Anonymous No.715880747 >>715881176
>>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.
Anonymous No.715880786 >>715881019 >>715881110 >>715881521 >>715901134
>>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.
Anonymous 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 No.715881019
>>715880786
My coworker does this to our game engine and it makes blood shoot out of my eyes from the stress
Anonymous No.715881110
>>715880786
that is good, I'm sick of updates to things breaking them, maintenance is gay
Anonymous No.715881176
>>715880747
> That's not programming because I don't like the way it looks.
Tranny tier.
Anonymous No.715881367
>>715880541
>depends on Visual Studio
you can compile with mingw
Anonymous No.715881452 >>715881567 >>715881708 >>715881782 >>715882467 >>715886935
>program in C++
>have to type in "sexually transmitted disease" every other line
What were they thinking?
Anonymous 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 No.715881567
>>715881452
>being homosexual
have you tried using contraceptives? maybe then aids won't live in your head rent free
Anonymous No.715881708
>>715881452
>name isn't a wstring
Anonymous No.715881782 >>715882073 >>715882158
>>715881452
>this->
Huh? Somebody who isn't dumb explain why he's dereferencing this
Anonymous 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 No.715881934 >>715884268
Is GameMaker's language hard to learn?
Anonymous No.715882021
>>715879691
Most people who dislike Rust got filtered by it.
Anonymous No.715882073 >>715882115
>>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
Anonymous No.715882115 >>715882223 >>715882270
>>715882073
I'm pretty sure you can just do name = name;
Anonymous No.715882158 >>715882295 >>715882330
>>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.
Anonymous No.715882223 >>715882709
>>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
Anonymous No.715882270
>>715882115
Then you'd just assign the value back into the parameter, retard
Anonymous No.715882295 >>715882330
>>715882158
>adds this->
>doesn't add const& or std::move to string argument
sasuga
Anonymous No.715882330 >>715882594
>>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
Anonymous No.715882459 >>715882507 >>715882564 >>715882970 >>715887017 >>715888612
>>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?
Anonymous No.715882467 >>715882635 >>715882709
>>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.
Anonymous No.715882507
>>715882459
Have very specific problems instead of general ones
Anonymous No.715882564 >>715882805
>>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.
Anonymous No.715882594 >>715882698
>>715882330
yes, I also overload for & and && getters because I'm not h1b1
Anonymous No.715882635
>>715882467
>in the copy constructor
in the constructor*
Not sure why I wrote copy there.
Anonymous No.715882698
>>715882594
Based and optimization pilled.
Anonymous No.715882709 >>715882981
>>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
Anonymous No.715882805 >>715882881
>>715882564
Doesn't look very detailed. I liked Qt's documentation for ther qgraphicsscene visualisation framework more.
Anonymous No.715882881
>>715882805
It doesn't look that detailed because SDL is pretty simple to use.
Anonymous 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 No.715882970 >>715883626
>>715882459
Read comments in headers, they are more detailed than any documentation you come upon online.
Anonymous No.715882981
>>715882709
Just because nobody cares doesn't make it not bad practice.
Anonymous No.715883094 >>715883198
>>715867224
just use chatgpt unironically
Anonymous No.715883198
>>715883094
But what if I want to use it as a comic relief?
Anonymous No.715883626
>>715882970
I'll try doing that next time, thanks.
Anonymous 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 No.715884268 >>715884898
>>715881934
No, but it's bad
Mess with it for a year or so and move on to Godot or Unity
Anonymous No.715884531 >>715884645 >>715885503 >>715885904 >>715886870 >>715902780
What the FUCK do macros even do?
Anonymous No.715884645
>>715884531
they fuck. really hard and long
Anonymous No.715884898 >>715885803
>>715884268
Is GMS 2 good? Does it have indexed color / palette support?
Anonymous 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 No.715885803 >>715892145
>>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.
Anonymous 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 No.715886418 >>715886529
If C is so good, why isn't there D?
Anonymous No.715886529
>>715886418
You're in luck
https://en.wikipedia.org/wiki/D_(programming_language)
Anonymous No.715886623
>>715865647 (OP)

OOP is just vibe coding
Anonymous 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 No.715886935
>>715881452
using namespace std; // fuck anyone who cries about it
Anonymous No.715887017
>>715882459
ChatGPT
Anonymous No.715887026 >>715887814
>>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
Anonymous No.715887814 >>715888280
>>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.
Anonymous No.715888280
>>715887814
c kiddies are known liars and homosexuals
Anonymous 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 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 No.715889542 >>715891423 >>715901025
>>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.
Anonymous No.715889614 >>715894356 >>715898285
okay but how do i make my 2d rpg in 1 month?
Anonymous No.715889831 >>715889949 >>715890028
>>715865647 (OP)
just use c
+1 is just bloat
Anonymous No.715889945
>>715867224
wait until you hit compile and get alien error message
Anonymous No.715889949 >>715891030
>>715889831
but how do i use it to make my game?
Anonymous No.715890028 >>715890138
>>715889831
c kiddies are known liars and trannies
Anonymous No.715890068 >>715890138
>>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.
Anonymous No.715890138
>>715890068
see here >>715890028
Anonymous No.715890190 >>715890650
>>715877621
>OOP was a mistake
yeah thinking this
Anonymous No.715890272
>>715879691
sounds like you spend all your time getting it to compile rather than actual development
Anonymous 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 No.715891030 >>715907494
>>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.
Anonymous No.715891237
>>715877621
You don't struggle with a lack of polymorphism in C?
Anonymous No.715891252 >>715891839 >>715892225
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.
Anonymous No.715891264
>>715865647 (OP)
Speed. Hardware is designed around it.
Anonymous No.715891335
>>715865647 (OP)
Inertia
Thankfully much better designed languages such as C# are taking over now
Anonymous No.715891423 >>715891997
>>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
Anonymous No.715891569
Jai will save us.
Anonymous No.715891753 >>715892735 >>715892997 >>715900896 >>715902076
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.
Anonymous No.715891839
>>715891252
C# is for unity scripting.
Anonymous 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 No.715892145
>>715885803
Alright probably will stick to my opengl game then. I still havent figured out sprites but whatever
Anonymous 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 No.715892675
>>715865647 (OP)
it's old and well-known
Anonymous No.715892735 >>715893927
>>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
Anonymous No.715892990
>>715867095
>open source
Anonymous No.715892997 >>715893213 >>715893254
>>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.
Anonymous No.715893213 >>715893269
>>715892997
book source?
Anonymous 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 No.715893269 >>715893453
>>715893213
game engine architecture
Anonymous No.715893453 >>715893591
>>715893269
im not buying a book full of stolen techniques. I he's ok with stealing than he should be on with me pirating
Anonymous No.715893591 >>715893757
>>715893453
it's ok to be poor anon
Anonymous No.715893757
>>715893591
never said it wasnt
Anonymous No.715893927 >>715894552
>>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.
Anonymous No.715894356
>>715889614
Start with a level editor
Anonymous 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 No.715894552 >>715896223
>>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
Anonymous No.715894754 >>715895242
>game engines don't make sense to me
>coding the whole thing makes sense to me
>everyone says making game this way is impossible
Anonymous No.715894847
>>715872178
based fellow real time systems course taker
Anonymous No.715895036
>>715872384
if you make the right refactors this shouldn't be a big lift
Anonymous No.715895242 >>715895321
>>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.
Anonymous No.715895265 >>715896608
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++?
Anonymous No.715895321
>>715895242
x86 asm is interpreted by CPU, it's not precise. Have a nice day.
Anonymous No.715895346 >>715895458
c++ny
Anonymous No.715895458
>>715895346
>cppreference.com
Anonymous No.715895590
>>715865647 (OP)
Sega Mega Drive Assembly
Anonymous 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 No.715895818 >>715896014 >>715907447
>>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.
Anonymous No.715895859 >>715895927
>>715867095
SDL3 is magical so far
Anonymous No.715895920 >>715896408
It's over, sepple is DEPRECATED.
Anonymous No.715895927
>>715895859
Elaborate
Anonymous 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 No.715895952
>>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 No.715896014
>>715895818
GUI is primary usecase for POOP, with videogames you have to actively use DoD if you're CPU-bound.
Anonymous No.715896223 >>715896716
>>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.
Anonymous No.715896408 >>715897256
>>715895920
Anonymous 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 No.715896626
>>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 No.715896716 >>715897257 >>715897469
>>715896223
Ah, you mean C is slow because it's stuck with function pointers. That's common knowledge.
Anonymous 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 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 No.715897256
>>715896408
damn, it is actually well put together and 100% true
Anonymous No.715897257
>>715896716
all that speed and no one to maintain it...
Anonymous No.715897290 >>715898147 >>715898436
>>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.
Anonymous No.715897469 >>715897893
>>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.
Anonymous No.715897893 >>715903307
>>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.
Anonymous 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 No.715898147 >>715898608
>>715897290
>Read the standard.
AAAIIIIIIIEEEEEEE NOOOOOOOOOOOOO
Anonymous No.715898285
>>715889614
Use RPGmaker and ruby
Anonymous 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 No.715898392 >>715898487
>>715878297
He's right. It's pretty common for game developers to use C++ as "C with convenience features".
Anonymous 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 No.715898487 >>715898647
>>715898392
"game developers" are not serious devs. I mean lol. lmao even.
Anonymous No.715898608
>>715898147
You WILL read the standard and you WILL be happy.
Anonymous No.715898647 >>715898909
>>715898487
some of them are alright, like factorio devs
Anonymous No.715898751
>>715865793
kek
Anonymous No.715898909 >>715901001
>>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")
Anonymous No.715899804 >>715900496
>>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
Anonymous 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 No.715900396 >>715900608 >>715900774 >>715901239
>>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
Anonymous No.715900496 >>715900646
>>715899804
It can't be worse than C/C++ compile times. Right .... right?
Anonymous No.715900569 >>715900626 >>715900668 >>715900770 >>715901774 >>715908585
I underestimated how hard coding was, holy fuck. Toby Fox is inhuman for how he did it by himself.
Anonymous No.715900587
>>715867095
for me, it is c++ and sfml autism
Anonymous No.715900608 >>715901239
>>715900396
>>no classes and inheritance
>>no templates
>>no RAII
>>no generics or function overloading
Good
>>the disgusting garbage that are c strings
Fair point
Anonymous No.715900626 >>715908585
>>715900569
Toby can't code for shit either lol
Anonymous 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 No.715900668 >>715900786 >>715908585
>>715900569
Robert Fucks used Gamemaker
Much easier than coding it all yourself
Anonymous No.715900751
>>715869626
game? nah, I wrote an HMI application at work. They sell it for BigMoney™
Anonymous No.715900770
>>715900569
Don't worry. It'll click, eventually.
Anonymous 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 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 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 No.715900986
>>715867095
this, with OpenGL
Anonymous No.715901001 >>715901361 >>715901367 >>715901727
>>715898909
Which C++ bloat features are actually good?
Anonymous 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 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 No.715901239 >>715901416 >>715901448 >>715901669
>>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.
Anonymous No.715901361
>>715901001
They're mostly all good if you're aware of how they work under the hood.
Anonymous No.715901367 >>715901872
>>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
Anonymous 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 No.715901448 >>715901734 >>715901964
>>715901239
>elegant
strnggrtngmnscnnyhitlerhimmlerfggt_s("nigger", "tongue", len + 1 + forgot_the_fucking_terminator);
Anonymous 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 No.715901669 >>715901964
>>715901239
Anonymous No.715901705
Just use function pointers
Anonymous No.715901727
>>715901001
>bloat
did your favourite streamer tell you that?
Anonymous No.715901734
>>715901448
Heh. Not that kind of elegant, the kind that it fits everything that is happening in C so well.
Anonymous No.715901768 >>715902106
I hate pointers
Anonymous No.715901774 >>715902008
>>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.
Anonymous No.715901872 >>715903286
>>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
Anonymous No.715901923
>>715867826
>i dont know what any of this means but i'm going to argue about it
retard
Anonymous No.715901964
>>715901448
>>715901669
And so far I don't like string.h as well. just write your own functions lmao
Anonymous No.715901983 >>715902167 >>715902291 >>715902454 >>715902629 >>715902635 >>715902718
>C
char *data = malloc(size)
>C++
char *data = (char *)malloc(size)

why?? just auto cast void pointers wtf
Anonymous No.715902008 >>715902449
>>715901774
Let's see your games then, smartguy.
Anonymous No.715902076
>>715891753
>templates too take up too much computing time.
What? Templates are processed at compile time.
Anonymous No.715902106
>>715901768
imagine pass data that larger than eight bites
Anonymous 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 No.715902167 >>715902402
>>715901983
>what is type safety
Anonymous 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 No.715902190 >>715902286 >>715902295 >>715902647 >>715902941
Why should I ever need to use Malloc?
Anonymous No.715902286
>>715902190
You can't put everything on the stack.
Anonymous No.715902291 >>715902635
>>715901983
>ever using malloc
Anonymous No.715902295
>>715902190
if you use C then you need it but in C++ dont bother and learn the modern type safety ways
Anonymous No.715902402 >>715902585
>>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
Anonymous No.715902440 >>715902530
>>715867095
what if I also want a job?
Anonymous No.715902449
>>715902008
I'm learning OpenGL. Give me a few months.
Anonymous No.715902454 >>715902634 >>715902827
>>715901983
>I want a strongly typed language
>nooo not like this
Anonymous No.715902530
>>715902440
You learn Java sir.
Or Rust ma'am (sir).
Anonymous No.715902585 >>715902827
>>715902402
dont use void pointers. dont be stupid
Anonymous No.715902629
>>715901983
std::unique_ptr data{std::make_unique(size)};
Anonymous No.715902634 >>715902729
>>715902454
>strongly typed
Yeah man implicitly converting bool to int is very strongly typed
Anonymous No.715902635
>>715901983
>not casting malloc's return value
heretic
>>715902291
lol babby
Anonymous No.715902647 >>715902748
>>715902190
When you want to allocate memory?
Anonymous No.715902718 >>715902787
>>715901983
std::string data;
Anonymous No.715902729
>>715902634
>bool
No such thing.
Anonymous No.715902748 >>715902838
>>715902647
retard
Anonymous No.715902780 >>715903902
>>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")
Anonymous No.715902787 >>715902972 >>715910116
>>715902718
That wastes memory on storing the length
Anonymous 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 No.715902838 >>715902974 >>715903226
>>715902748
>malloc
>memory allocate
>doesnt mean memory allocate
Anonymous No.715902907
imagine not using smart pointers
>dude I'm such a LE EPIC hacker, I'm gonna make my codebase unmaintainable
Anonymous No.715902941
>>715902190
To overload the new operator
Anonymous No.715902972 >>715903031
>>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?
Anonymous No.715902974
>>715902838
retard (2)
Anonymous No.715902995
>>715872384
SDL's just better and with 3 they put more effort into documentation
Anonymous No.715903017 >>715903119 >>715903450
What would the ideal programming language for making video games look like?
Anonymous No.715903031 >>715903181
>>715902972
Already kept track of externally. Clearly, there is no need to duplicate it.
Anonymous No.715903038
>>715865647 (OP)
high performance + powerful abstractions
there's no other language that gives you both of these
Anonymous No.715903062 >>715903335 >>715903341
I don't understand why Godot repeated Gamemaker's mistake of needlessly introducing its own custom scripting language.
Anonymous No.715903071 >>715903304
>>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.
Anonymous No.715903097 >>715903142 >>715903306 >>715905532 >>715906407
I just think it looks nicer.
Anonymous 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 No.715903119
>>715903017
scratch because video games are for children
Anonymous No.715903142
>>715903097
Both are bottom-tier because the font isn't monospace
Anonymous No.715903181 >>715903256 >>715903985
>>715903031
Write a function that retrieves the size of malloc'd data from this "external" source.
Anonymous No.715903226 >>715903389
>>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.
Anonymous No.715903256 >>715903405
>>715903181
Where did you attain the variable "size" from?
Anonymous No.715903286
>>715901872
im saying its bloated, not that it's bad
Anonymous No.715903304 >>715903346 >>715903401
>>715903071
RAII isn't a garbage collector thoughbeit
Anonymous No.715903306 >>715903446
>>715903097
left is more readable when viewing nested code in a simple editor
Anonymous No.715903307
>>715897893
The issue is that your everyday generic hidden vtables that C++ introduces trash the cache.
Anonymous No.715903314 >>715903578
Here's what C looks like to a normal programmer
*auto const& *var = const& (*)(getValue(&input) const*;
Anonymous No.715903335
>>715903062
https://docs.godotengine.org/en/stable/about/faq.html#what-is-gdscript-and-why-should-i-use-it
Anonymous No.715903341 >>715903547 >>715903558
>>715903062
Does this shit have proper C# support yet?
Anonymous No.715903346
>>715903304
It literally is
Anonymous No.715903389 >>715903509
>>715903226
>malloc
>mmap
this is a c++ thread
Anonymous No.715903401 >>715905684
>>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.
Anonymous No.715903405 >>715903473
>>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.
Anonymous 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 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 No.715903473 >>715903592
>>715903405
But the variable "size" already exists. There is no need to create anything.
Anonymous No.715903509
>>715903389 -> >>715866945
Anonymous 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 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 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 No.715903592
>>715903473
With a std::string you never need an external size variable at all.
Anonymous No.715903681 >>715903741 >>715903753
>>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.
Anonymous 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 No.715903753 >>715903880 >>715903883 >>715903918 >>715903934 >>715903995
>>715903681
If I just want to recreate RPG Maker what should I use?
Anonymous No.715903808 >>715903859
>>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.
Anonymous No.715903859
>>715903808
That's called job security
Anonymous No.715903880
>>715903753
For that you could use just about anything
Anonymous No.715903883
>>715903753
C
Anonymous No.715903902 >>715903980 >>715904119
>>715902780
and logging.cpp to complete it
Anonymous No.715903918
>>715903753
any language you want that has raylib bindings
https://github.com/raysan5/raylib/blob/master/BINDINGS.md
Anonymous No.715903934
>>715903753
RPGMaker. Don't overcomplicate things - use the appropriate tool for the job.
Anonymous No.715903980
>>715903902
i::fucking::love::c++::syntax
Anonymous No.715903985 >>715904271 >>715904729
>>715903181
It's not portable, but you can do that.
Anonymous No.715903995
>>715903753
>If I just want to recreate RPG Maker what should I use?
Unity.
Anonymous No.715904119 >>715904729
>>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
Anonymous 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 No.715904271 >>715904795
>>715903985
>It's not portable
So it's a hacky, non-performant work-around to using at most, 8 bytes of extra memory.
Anonymous No.715904516 >>715904659
>heh you can't run it an an ENIAC? uhh not portable sweaty! ;)
why are cniles so obsessed with running on 9000000 obscure platforms
Anonymous 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 No.715904659 >>715904738
>>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.
Anonymous No.715904729 >>715904985
>>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
Anonymous No.715904738 >>715905014
>>715904659
>Rust is becoming too powerful
how are those compile times doing champ?
Anonymous No.715904795 >>715904898
>>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.
Anonymous No.715904898
>>715904795
Fair enough. It is interesting that such a function exists.
Anonymous No.715904985 >>715905021
>>715904729
oh I wasn't intending to slam anon, I genuinely wanted to know the reason for using const& on only one of them
Anonymous No.715905014 >>715905246
>>715904738
>how are those compile times doing champ?9ụSegmentation fault (core dumped)
Anonymous No.715905021
>>715904985
im not slamming either jus making a suggestion :-)
Anonymous No.715905123 >>715905248
>>715865793
template Woman* MakeWoman(T&& person) const { return reinterpret_cast(&person); }
Anonymous No.715905182
>>715865793
literally rent free
Anonymous No.715905246
>>715905014
Yeah i don't use C shit either
Anonymous No.715905248 >>715905445 >>715905729
>>715905123
where's the IsWoman constraint
Anonymous No.715905351 >>715905472
>>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
Anonymous No.715905445
>>715905248
You don’t need one. C++ is the most trans friendly language ever.
Anonymous No.715905472 >>715905678
>>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
Anonymous No.715905532
>>715903097
Left can claim to have 4 lines of code, which will impress idiots.
Anonymous No.715905579 >>715905619
I just use boost::shared_ptr and call functions and stuff
Anonymous No.715905619
>>715905579
>C++ users HATE him
Anonymous No.715905678 >>715905815 >>715905843
>>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
Anonymous No.715905684 >>715906234 >>715906662
>>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 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.
Anonymous 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 No.715905729 >>715905882
>>715905248
bool Person::IsWoman() const { return chromosomes.sex[0] == "X" && chromosomes.sex[1] == "X"; }
Anonymous No.715905815 >>715905990
>>715905678
It is hacky, it's hacky language design, it results in very complex side effects and it makes compile times much slower
Anonymous No.715905843 >>715906137
>>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.
Anonymous No.715905882 >>715906307
>>715905729
>using an array with strings for something you know only ever has two entries with 2 possible values
Anonymous No.715905990 >>715906135
>>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.
Anonymous No.715905994
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 No.715906135 >>715906395
>>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
Anonymous 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 No.715906234 >>715906317
>>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.
Anonymous No.715906307 >>715906360
>>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.)
Anonymous No.715906317 >>715906436
>>715906234
some people think GC only means "mark and sweep deferred collection"
Anonymous No.715906360 >>715906396
>>715906307
those are undefined behavior
Anonymous No.715906395 >>715906503
>>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.
Anonymous No.715906396
>>715906360
kek
Anonymous No.715906407 >>715911054
>>715903097
Anonymous 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 No.715906482 >>715906662 >>715907135
> 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
Anonymous No.715906503 >>715906612 >>715906621
>>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
Anonymous 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 No.715906621 >>715906709
>>715906503
What is your proposed solution? The only thing I find disgusting about C++ is the retarded std::visit stuff
Anonymous No.715906662
>>715906482
oops forgot to reply to >>715905684
Anonymous No.715906709 >>715906835
>>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
Anonymous No.715906835 >>715906871
>>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?
Anonymous No.715906871 >>715906914 >>715906959 >>715906982
>>715906835
I have no idea what concepts are in relation to C++
Anonymous No.715906914 >>715906995
>>715906871
Right. I figured as much
Anonymous No.715906959
>>715906871
Not that anon but they're template parameter constraints
https://en.cppreference.com/w/cpp/language/constraints.html
Anonymous No.715906982
>>715906871
custom templates with constraints (C++ users are discovering contract programming)
Anonymous No.715906995 >>715907052 >>715907139
>>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
Anonymous No.715907052 >>715907110
>>715906995
>20 years
Anon...
Anonymous No.715907110 >>715907132 >>715907251
>>715907052
How long have templates been in C++?
Anonymous No.715907132
>>715907110
closer to 40 than 20...
Anonymous No.715907135 >>715907226 >>715907286
>>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.
Anonymous No.715907139
>>715906995
dw cpp2 is on the way!
Anonymous 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 No.715907226 >>715907527
>>715907135
You can't micro bench shared pointers because adjusting the reference count is something that happens everywhere a shared pointer is used
Anonymous No.715907251
>>715907110
35 years or something
Anonymous No.715907286 >>715907383 >>715911243
>>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
Anonymous No.715907383
>>715907286
Just turn on DLSS
Anonymous No.715907431 >>715907504 >>715907539
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.
Anonymous No.715907447 >>715907489 >>715907541 >>715907551
>>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.
Anonymous No.715907489
>>715907447
Components are not an alternative to OOP
Anonymous No.715907494
>>715891030
interesting. you sound just like my coding teacher in college. guess i'll dust off these decade of rust
Anonymous No.715907504
>>715907431
> interpreted languages are better.
Ask Godot users how much they love GDS lol
Anonymous No.715907527 >>715907590
>>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
Anonymous No.715907539
>>715907431
>he doesn't know about hot reloading
Sub-second segfaults, can your stinky interpreted (((language))) do that?
Anonymous No.715907541
>>715907447
99% of games are still using OOP and having components doesnt make something not OOP
Anonymous 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 No.715907578
why isn't it called ++C, pre increment is more efficient
Anonymous No.715907590 >>715907829 >>715908046
>>715907527
Changing a reference every time you access a pointer has a significant performance cost
Anonymous No.715907776 >>715908009
>>715867224
lol no, probably CSfags who think everything they do is high IQ
Anonymous 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 No.715907829 >>715907971
>>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 .
Anonymous No.715907883 >>715907969 >>715907975 >>715908131
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.
Anonymous No.715907969 >>715908056
>>715907883
the point was originally how C++ users are sometimes unaware of the automatic memory solutions they use while bemoaning gc
Anonymous No.715907971 >>715908046 >>715908548
>>715907829
that's what i meant
Anonymous 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 No.715908009 >>715908063 >>715908106
>>715907776
Okay, have that guy explain what std::forward does
Anonymous 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 No.715908046 >>715908159
>>715907590
>>715907971
Show me the benchmarks in a real-world scenario. I promise you it's a nothingburger
Anonymous No.715908056
>>715907969
Fair enough
Anonymous No.715908063
>>715908009
forwards something as an rvalue or some shit
Anonymous No.715908106
>>715908009
meant for >>715867224
Anonymous No.715908131 >>715908158 >>715908237 >>715908394
>>715907883
>Unique pointers with raw pointers as observers
dont do that. it only needs 1 jeet that delete the dangling pointer
Anonymous No.715908158 >>715908208
>>715908131
Anon, shared memory ownership is a far bigger can of worms.
Anonymous No.715908159
>>715908046
yeah let me write a program of significant size that I can remove the shared ptrs from real quick
Anonymous No.715908208 >>715908825 >>715909085
>>715908158
>Shared ownership is extremely flimsy
please explain
Anonymous No.715908237 >>715908825
>>715908131
It's fine as long as the observers never leave scope of the owner.
Which they inevitably will.
Anonymous No.715908394 >>715908441
>>715908131
Option Types would fix a lot of problems in C
Anonymous No.715908441 >>715908494 >>715908917
>>715908394
option types dont solve that problem and option types are trivial to implement in C++
Anonymous No.715908494
>>715908441
>implement
it's a standard library wrapper
Anonymous No.715908548 >>715908618
>>715907971
if reference counting has a nontrivial performance impact on your software you're probably doing something wrong
Anonymous No.715908585 >>715908672 >>715908841 >>715909835
>>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.
Anonymous No.715908618 >>715908706 >>715909025 >>715909297
>>715908548
yes, that thing is using reference counting too much
Anonymous No.715908672 >>715909056
>>715908585
If you think you posted an example of shit code you're a retard
Anonymous No.715908706
>>715908618
it only does that when YOU copy or destroy it. it's all YOUR fault
Anonymous No.715908825 >>715908860 >>715908951
>>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
Anonymous No.715908841 >>715909056
>>715908585
what is this language
Anonymous No.715908860 >>715909302
>>715908825
>It means you don’t understand the object’s lifetime.
No it doesn't, it means it has a complex lifetime
Anonymous No.715908917 >>715908972
>>715908441
they would because some(none) wouldn't crash your program like null does.
Anonymous No.715908951 >>715909302
>>715908825
I dont think you ever wrote anything more substantial than hello world
Anonymous No.715908972 >>715909086
>>715908917
you don't understand what you're talking about
Anonymous No.715909009
>>715865647 (OP)
doesn't force you into a programming style.
Anonymous No.715909025 >>715909080
>>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?
Anonymous No.715909056 >>715909114
>>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
Anonymous No.715909080 >>715909167
>>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
Anonymous No.715909085 >>715909347
>>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.
Anonymous No.715909086 >>715909161
>>715908972
how am i wrong exactly?
Anonymous No.715909114 >>715909576
>>715909056
>>boolean galore for defining behaviors
There is nothing wrong with this
Anonymous No.715909127
>>715868042
>bloated mess
you only pay for what you use
Anonymous No.715909161 >>715909395
>>715909086
an option type won't save you if it's pointing to something that got deleted somewhere else
Anonymous No.715909167 >>715909196 >>715909758
>>715909080
Great! So you've benchmarked shared pointers vs raw pointers in a real-world scenario then?
Anonymous No.715909196 >>715909237
>>715909167
yes
Anonymous No.715909237 >>715909293
>>715909196
May I see the benchmarks?
Anonymous No.715909293
>>715909237
I didn't save them
Anonymous No.715909297
>>715908618
Commenting every like is fucking retarded.
Anonymous No.715909302 >>715910102
>>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
Anonymous No.715909308 >>715909396
Benchmarking the performance of shared pointers vs raw pointers is impossible because they solve different problems
Anonymous No.715909347 >>715909559
>>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.
Anonymous 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 No.715909396 >>715909524
>>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
Anonymous No.715909524 >>715909761
>>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
Anonymous No.715909536 >>715909602 >>715909713
I wish there was a modern C++. Rust and Zig are VERY close but not quite there yet.
Anonymous No.715909559 >>715909974
>>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.
Anonymous No.715909576 >>715909661 >>715909791 >>715909838
>>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.
Anonymous No.715909602 >>715909756
>>715909536
https://tour.dlang.org/
Anonymous No.715909661 >>715910228
>>715909576
If you actually believe this, you should be able to explain why it's bad
Anonymous No.715909671 >>715909719 >>715909724
Because it is used in Unity, which is an engine for people who actually develop (and finish) their games
Anonymous No.715909713
>>715909536
Just write down your requirements in the English language and ask Claude to write it in x86SAM for optimal performance.
Anonymous No.715909719 >>715909785
>>715909671
What? C++ is not used in Unity.
Anonymous No.715909724 >>715909785
>>715909671
Anonette, unity uses c#.
Anonymous No.715909756 >>715909889
>>715909602
>null values
roflmao
Anonymous No.715909758 >>715909880
>>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.
Anonymous No.715909761 >>715909918
>>715909524
>Anon, that would lead to objects outliving their lifetimes
so? it just means you waste some memory, that's fine for a benchmark
Anonymous No.715909785
>>715909719
>>715909724
My bad thought OP was talking about C# for some reason lol
Anonymous No.715909791
>>715909576
>It'd be better to use a strategy pattern for behaviors
Can you actually explain why?
Anonymous 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 No.715909838 >>715909907 >>715910357
>>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?
Anonymous 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 No.715909889 >>715910210
>>715909756
you're not going to avoid null unless you go into functional languages.
Anonymous No.715909907
>>715909838
>Who tought you how to program?
the same person who tote you englishe
Anonymous No.715909918 >>715910004
>>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.
Anonymous No.715909974
>>715909559
>Cpp relies on RAII.
it does not. there is something called functional
Anonymous No.715910004 >>715910049
>>715909918
The benchmark is simply the cost of reference counting vs not reference counting
Anonymous No.715910049 >>715910084
>>715910004
No, the second scenario you're suggesting would also not free resources
Anonymous No.715910084 >>715910241 >>715910779
>>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
Anonymous 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 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(size)[/code] is equal to [code]new char[]()[/code], the () makes the value initialized with zero)
Anonymous No.715910210 >>715910427 >>715910763
>>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
Anonymous No.715910228 >>715910394 >>715910428 >>715910686 >>715910760
>>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.
Anonymous 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 No.715910241 >>715910338 >>715910779
>>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
Anonymous No.715910338 >>715910779
>>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
Anonymous No.715910357 >>715910527
>>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?
Anonymous No.715910394 >>715910959
>>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
Anonymous No.715910427 >>715910645
>>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?
Anonymous No.715910428 >>715910959
>>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
Anonymous No.715910527 >>715910959
>>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
Anonymous No.715910645 >>715910785
>>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
Anonymous 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 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 No.715910763 >>715910874
>>715910210
>Now you never have nullptr issues but you have null wrapper issues
Which are caught at compile time.
Anonymous No.715910779 >>715910924
>>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.
Anonymous No.715910785 >>715910945
>>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
Anonymous No.715910831
Shared pointer users are not human.
Anonymous 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 No.715910916 >>715912090
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
Anonymous No.715910924 >>715911306
>>715910779
Yes you still add the check if needs to be freed check, you just don't free it if it passes
Anonymous No.715910945 >>715911036
>>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)
Anonymous No.715910959 >>715911041 >>715911087 >>715911145
>>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.
Anonymous No.715911036 >>715911071 >>715911250
>>715910945
Something more productive then.
What IS a modern C++ successor to you then?
Anonymous No.715911041 >>715911254
>>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
Anonymous No.715911054
>>715906407
goto fail;
goto fail;
Anonymous No.715911071 >>715911314 >>715911446
>>715911036
Java
Anonymous 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 No.715911145 >>715911360 >>715911865
>>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
Anonymous No.715911243
>>715907286
>16ms
144Hz gamerchads did not like this
Anonymous 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 No.715911254 >>715911283
>>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
Anonymous No.715911283
>>715911254
every AA/AAA game made since 2003 does not store linked lists in a projectile lil bro
Anonymous No.715911306 >>715911450
>>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.
Anonymous 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 No.715911351
in reality, you'd actually want to use bitarrays because they'd also simplify your networking
Anonymous No.715911360 >>715911465
>>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.
Anonymous No.715911446
>>715911071
Java is more of a successor to COBOL than anything at this point.
Anonymous No.715911450 >>715911601
>>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
Anonymous No.715911465 >>715911649 >>715911657
>>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
Anonymous No.715911601 >>715911902
>>715911450
This does not address the second and third issue.
Anonymous No.715911649 >>715911897
>>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.
Anonymous No.715911657 >>715912013
>>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
Anonymous 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 No.715911897 >>715912138
>>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.
Anonymous No.715911902 >>715912065
>>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
Anonymous No.715912013 >>715912094
>>715911657
So are you actually going to refute anything I said or
Anonymous No.715912065 >>715912183
>>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.
Anonymous 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 No.715912094 >>715912120
>>715912013
You don’t refute a tantrum.
Anonymous No.715912120
>>715912094
I accept your concession!
Anonymous No.715912138 >>715912229
>>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?
Anonymous No.715912183 >>715912383
>>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
Anonymous 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 No.715912383 >>715912449
>>715912183
Unless you don't use the standard allocator.
Anonymous No.715912449
>>715912383
Yes, if you use a custom allocator it's even more consistent because you know exactly what's happening