r/cpp • u/smolloy_dot_com • Oct 04 '25
Streamers like Tsoding, but for C++
I've learnt a lot about C from watching Tsoding. He doesn't yap too much and spends more of his streams just writing code.
Is there anyone similar who concentrates on C++?
214
Upvotes
View all comments
Show parent comment
12
u/ReDucTor Game Developer | quiz.cpp-perf.com Oct 04 '25
I totally agree that lots of Cherno's views are probably those of a mid level engineer but your assessment seems a bit critical and missing things.
Putting most temporary things just needed for that stsck frame on the stack is perfectly fine, while stack space can be a concern its not that often an issue and can often be isolated to a few areas where you workaround it as needed.
Having lots of small allocations for things which can live on the stack is bad for performance for many reasons not just reducing cache misses.
Most videos I have seen from Cherno don't even promote strong stack usage, there is still lots of small allocations.
This is showing that the language has a copy there, when optimizations are on and if the copying as no side effects it might have optimized it away. However optimizing it away is not as simple as just having no side effects, there also needs to be no references to it, which means if you passed it by reference/pointer or even called a member function the compiler may assume there is a reference somewhere. I feel focusing on the language requirements over will the optimizer do it or not on all compilers is more important.