Chapter 2. Classes

“Computer science is no more about computers than astronomy is about telescopes.”

—Edsger W. Dijkstra

Accordingly, computer science is more than drilling on programming language details. That said, this chapter will not only provide information on declaring classes but also give an idea of how we can make the best use of them, how they best serve our needs. Or even better: how a class can be used conveniently and efficiently in a broad spectrum of situations. We see classes primarily as instruments to establish new abstractions in our software.

2.1 Program for Universal Meaning Not for Technical Details

Writing leading-edge engineering or scientific software with a mere focus on performance details is very painful and likely ...

Get Discovering Modern C++: An Intensive Course for Scientists, Engineers, and Programmers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.