|
|
|
|
|
by fsloth
695 days ago
|
|
No, don’t abuse the language. Wrap everything in types and all is fine. Verbose C++ is the only good kind of C++. Why? C++ code needs to be debuggable and modifiable so when a profiler shows hotspots, you know where they are coming from and react appropriately. How do you fix a hotspot on a one line of code somewhere in the middle of a template thingsmajic? You don’t. You need to unroll the template code to untemplated code and the fix the hotspot. Cases where you don’t need to fix one line hotspots because the resources consumed by the code are irrelevant are fine. But if performance does not matter it likely means you should use a bette language than C++. Using C++ and not caring about performance finetuning is the worst of both worlds - you are using a cumbersome language AND it’s not even for any practical benefit. |
|