Chapter 2.1
P.11: Encapsulate messy constructs, rather than spreading through the code
In the course of this chapter we’ll learn about encapsulation, and also about the closely related concepts of information hiding and abstraction. These three are often used interchangeably, usually at the cost of clarity. Before we start, we want to set the scene by building a parser. We will return to these three concepts in a moment.
All in one gulp
One of the qualities that marks out a great engineer is the ability to notice when things start to get out of hand. We are all excellent at spotting when things have got completely out of hand: who has not started a code review with the phrase, “There’s quite a lot going on here and I found it hard to follow.” ...
Get Beautiful C++: 30 Core Guidelines for Writing Clean, Safe, and Fast Code 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.