Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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



The 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.


> 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?


I thought the second half would make it clear that I'm being sarcastic but clearly I'm wrong. Pendants gonna pedant I guess.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: