Chapter 37. Monoliths “Unstrung,” Part 1: A Look at std::string

Difficulty: 3

I've decided to conclude the Style Case Studies section somewhat impishly, with a miniseries targeting an example from the C++ standard library itself: std::string. We begin our critique with a review of an important design guideline and a contrasting overview of the standard string facility.

Solution

Avoid Unduly Monolithic Designs

  1. What is a monolithic class, and why is it bad? Explain.

The word “monolithic” is used to describe software that is a single, big, indivisible piece, like a monolith. The word “monolith” comes from the words “mono” (one) ...

Get Exceptional C++ Style 40 New Engineering Puzzles, Programming Problems, and Solutions 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.