Writing Efficient C++ Code: Key Practices (2013)

Original: Writing Efficient C++ Code (2013)

Why This Matters

Efficiency fundamentals age slowly; this piece remains a solid primer for systems programmers today.

A 2013 article republished from Polish magazine Programista outlines why C++ remains the go-to language for performance-critical software—games, real-time media, embedded systems—and introduces data-oriented design as a counterweight to naive object-oriented thinking.

Originally published in Programista magazine (issue 4/2013), this technical piece by Adam Sawicki argues that choosing C++ is only the first step toward efficient code. The author frames C++ as a rare middle ground: high-level enough to offer STL containers, custom types, and OOP abstractions, yet low-level enough to give direct access to memory and hardware without a garbage collector or VM introducing latency at unpredictable moments.

The article's motivating premise is blunt: fast hardware and cheap RAM do not eliminate the need for efficient code. Programs that run for years or ship on millions of machines accumulate costs—power, cooling, battery drain—that matter at scale. Real-time applications like games, where a frame-rate drop is immediately visible, or media streams locked to a fixed bitrate, have zero tolerance for performance slop. Fixed-hardware targets like game consoles make this even less forgiving.

The piece then pivots to data-oriented design as a corrective to over-engineered OOP. The author distinguishes between treating OOP as a philosophical abstraction system versus using it as a practical language tool, warning that the former can distance a programmer from the hardware realities that ultimately determine performance.

Source

asawicki.info — Read original →