Hacker News new | ask | show | jobs
by einpoklum 2465 days ago
> You are describing 'zero cost abstractions'

No, that's a different (and orthogonal) concept. The point is that in C++ "you don't pay for what you don't use" - whether it's a cheap or an expensive abstraction, if you don't use it then its overhead won't affect your code's performance.

However, many of the C++ abstractions are zero-cost in many common cases.

> Game developers and low level programmers shy away from them

No, they don't. They shy away from abstractions which are too expensive; or whose scope of optimization doesn't fit the game's use; or which don't combine well with out-of-standard-library code used in the game etc.

But game developers use _lots_ of C++ abstractions; and fancy non-C-like C++ features.