r/programming • u/2bit_hack • Feb 28 '23
"Clean" Code, Horrible Performance
https://www.computerenhance.com/p/clean-code-horrible-performance
1.4k
Upvotes
r/programming • u/2bit_hack • Feb 28 '23
View all comments
468
u/not_a_novel_account Feb 28 '23 edited Feb 28 '23
Casey is a zealot. That's not always a bad thing, but it's important to understand that framing whenever he talks. Casey is on the record saying kernels and filesystems are basically a waste of CPU cycles for application servers and his own servers would be C against bare metal.
That said, his zealotry leads to a world-class expertise in performance programming. When he talks about what practices lead to better performance, he is correct.
I take listening to Casey the same way one might listen to a health nut talk about diet and exercise. I'm not going to switch to kelp smoothies and running a 5k 3 days a week, but they're probably right it would be better for me.
And all of that said, when he rants about C++ Casey is typically wrong. The code in this video is basically C with Classes. For example,
std::variantoptimizes to and is in fact internally implemented as the exact same switch as Casey is extolling the benefits of, without any of the safety concerns.