You want to use C/C++ for micro-optimize your memory? lol be my guest, but don't be suprised when there's no support.
What do you mean by "no support"?
High-quality C++ compilers aren't going anywhere.
And the StackOverflow answers for C++ are generally more useful than the ones for webdev languages, due to less pajeet spam.
Also, it's not about "micro-optimizations". The big advantage of C++ over Python, for most projects, is not that C++ is memory-near but that it's strongly statically typed.
Hope you like scrambling for "segmentation fault in line 757 " when you forget to use malloc, or wondering why there's tons of memory leaks when you forget to free memory on some obscure cases.
Yes, memory-near programming languages have their pitfalls which can lead to bugs. But two things:
1) You're kinda cheating by referring to it as "C/C++" but then basing your actual examples entirely on C, where the programmer has to manually call malloc/free and is thus most vulnerable to those pitfalls.
C++ has gone a long way towards alleviating those pitfalls by letting you tie memory allocation to the well-defined lifetime of objects, in a way that is easy to reason about for human programmers.
Rust apparently goes even further in this direction, but I haven't looked into that language too deeply yet.
2) Dynamic-typed languages like Python and JS have their own pitfalls, which lead to at least as many bugs.
There are whole classes of bugs which a C++ compiler can find at compile-time, but in Python/JS code will only show up in production.
Java and C# avoid both of those classes of pitfalls (by being statically typed AND using garbage collection). But they fucked it up by (among other things) forcing every object variable/field/parameter to accept the value "null", thus forcing programmers to check for that value everywhere, which of course they fail to do, thus leading to millions of unnecessary NullPointerException bugs around the globe.
(C had the same problem, because it makes you pass around pointers all the time, but C++ had like 90% fixed that by relying heavily on value types and non-nullable references. Java/C# were a real step back here.)
For maximum bug-safety, you'd ideally want a language that...
- avoids manual memory management (so C is out, C++ is borderline)
- is strongly statically typed (so Python, JS are out)
- makes it easy and natural to pass around non-nullable object references (so C, Java, C#, Python, JS are out)
Is there, or will there ever be, such an ideal language (that doesn't fuck up in other ways)?
Is Rust it?
I don't known.
The reports of tranny infestation and woke CoC shenanigans have turned me off the Rust community, for now.
no ecosystem at all for web servers in C/CPP.
This is actually a legit point, yeah.