Overview

Map C++17 habits to the Musi Book without repeating every construct example.

C++17 builds large systems from value types, RAII, templates, overloads, exceptions, and carefully hidden resource edges. Musi keeps the taste for named operations and static promises, but separates stored shape from behavior contracts: records/data describe things, classes describe operations, effects and foreign declarations mark boundary work.

Use this guide as a translation journal for C++17 code. Start with the familiar habit, then ask which Musi construct owns the same promise. A page is successful when it tells you which old instinct to keep and which old shortcut to drop.

Start from the habit that hurts

Habits that still help

  • Keep the C++ habit of asking which operation is generic and which value owns shape.
  • Drop inheritance-first and overload-first reflexes when a record, data variant, or explicit instance says the same thing plainly.
  • Keep examples tied to ordinary work: receipts, routes, files, animals, people, rooms, and services.

First false friend

Musi class is closer to a concept or trait than a C++ class; records/data store shape, instances satisfy behavior. If you need a person, car, invoice, or package, start with records or data. If you need any type that can compare, show, encode, or step, use a class with instances.

When to switch to the Musi Book

Stay in this guide while a C++17 habit is getting in the way. Switch to Values and let, Records, Patterns, Generics, Classes, and Effects when you need the source-of-truth rule.