What a lot of these rage posts about C++ from people who either never coded in the language or just jumping on the wagon to hate realize is that C++ of 20 years ago is not the C++ of today. Entire forums and stackoverflow posts with incredibly horrible ancient C++ is still being seen as what the language is. And to make it all worse, all these places were scrapped for LLMs, so all the C+++ code generated out of these "AI" are horrible. The modern features of C++ make the language very, very accessible.
could mention any C++ feature and bro chose exceptions
Not using exceptions is based.
except, exceptions are shit and there literally is no reason to use them
Agreed with you until you mentioned exceptions
when i can, i love writing something as a constexpr function and then a few static_assert(..) lines 'calling' it with specific inputs as a compile time unit tests. you can loop trough arrays and everything! i just wish more of the math was constexpr.
This sounds like it‘s coming from someone who has not had to deal with the memory allocation issues that arise from the STL in a full game title, especially when shipping on memory-constrained hardware where fixed-block memory allocation is basically mandatory - That‘s also why most larger developers write their own containers/STL. See EASTL or the Defold engine for an open-source example.
The exceptions example was absolutely terrible, but other than that I agree with you 100%
my knowledge is limited, i feel like i can learn twice as much about cpp than about c# but i once made a simple program with someone in rust. it was like 30 lines of code and took 3 hours until it even compiled - and then it didn't even work lmao
Man, I used Ranges today and it was really fun... The only reason to not use them is because it might be a pain in the butt. Because as far as I know that default for all four of the major browse compilers is C++17... I don't use exceptions because they make my already complex control flow harder to follow... Also, I'm going to share this with everyone who refuses to use Smart pointers
I don't like exceptions. So much so that in my language there will be none :-) But most people who dislike exceptions actually have pretty valid points and alternatives. Actually C++ as-is today is a pretty awsome language - but for that awsome to come out, its best to curate features - both old and new out a bit. Then yes of course there are edge-cases where nearly all of the features are actually useful - even the more arcane ones. But when limiting to an arbitrary subset you literally get the best of C++: possibility being always there for all features, but well curated is your codebase.
everybody limits themself to an arbitrary subset of the language. that is a fundamental part of using c++. c++ is a highly featureful language with many eras, nobody is using all the features
There are many reasons not to use C++ STL--compile times is obviously the primary one.
I agree but at the same time the language is so large.
But most of the come with horrible syntax, semantics, poorly chosen defaults. And alot if them happen to have performance penalties.
just don't try to interop with other languages or with libraries compiled with another compiler or with shared objects or with the GPU in a meaningful way other than that sure ...
Aren't there performance reasons for avoiding exceptions? If my recollection is correct, I could imagine justifiable design restrictions on exceptions in the renderloop. Keep them to input handlers or async network callbacks or whatever as just one of the thousand cuts to keep your render ms as low as possible.
It's...almost kind of comical how the detracting comments are only detracting because they had to deal with issues arrising not from the language itself, but from how it was being used or the restrictions it had to be used under. If you're developing for limited hardware, especially if it's very limited hardware, then maybe CPP isn't the tool you need. If compile times are an issue, maybe it would be a good idea to check why they're so long, as unless you're building a very large app all at once, which why the hell would you do that, modern or even relatively modern hardware should not be struggling so much that you're significantly slowed down. And my god, if you're worried about the security issues that arise with having pretty direct access to the computer's memory, I actually don't know what to tell you. Basic vulnerabilities are effectively impossible to write so long as you flag the compiler with "-wall" or whatever your environment's equiv is. If you ignore those warnings, unless you have damn good reason, then you kind of brought security hell onto yourself. There are tools to ensure you're writing secure code, use them. The only thing, and I mean only thing that I don't like about CPP, and really C in general, is it's syntax; and that's just because it's a bit overwhelming as a beginner who started their programming journey in Lua first instead of something lower level.
That's exactly why I don't like C++
@FuzzhyFoo