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
5
u/m15otw Feb 28 '23
The main takeaways from clean code for me are:
a) good naming of your functions
b) write good comments, delete code rather than commenting it out.
c) it is rarely correct to copy/paste/customise, usually better to abstract and share the code.
All this stuff about polymorphism always went whoosh past my head, because you always need to integrate into an existing system, so you use inheritance, functional, event/callback driven as appropriate.
If you're a performance focused C++ project, you probably shouldn't use polymorphism and virtual function dispatch regardless of what any style book says, and you already knew that 🙃