2 ms·
This is not correct. Zero cost abstractions are not overhead. Some abstractions are zero cost abstractions. Thus, not all abstractions are pure overhead. More
by miohtama 4y ago
This is not correct. Zero cost abstractions are not overhead. Some abstractions are zero cost abstractions. Thus, not all abstractions are pure overhead.
More on zero cost abstractions here: https://stackoverflow.com/a/69178445/315168 https://stackoverflow.com/a/69178445/315168
- mixedCase 4y ago> Thus, all abstractions are not pure overhead Sorry for the pedantry, but I believe this would still be wrong as phrased. Maybe "not all abstractions are pure overhead" would work?
- asveikau 4y agoThe Stroustrup quote in that thread is better than what you linked to. The concept was popularized by C++ templates. The idea is that the templated code would be just as good as if you hand wrote it without generics. There's no extra function pointers or virtual calls, extra indirection by pointing to some user data, etc.; the tree node or whatever and data struct are declared as a single entity, there's no runtime callbacks, etc.
- _Algernon_ 4y agoI thought the second half would make it clear that I'm being sarcastic but clearly I'm wrong. Pendants gonna pedant I guess.