liveBook · Manning

Simplicity

As explained in API Design Patterns

Simplicity is the API design quality of exposing desired functionality straightforwardly without unnecessary user-facing complexity.

Simplicity means exposing the functionality users want in the most straightforward way possible—not merely minimizing RPCs, resources, or methods. A single ExecuteAction() call can hide complexity inside configuration, while a focused DetectLanguage() method makes its purpose clear. section 1.4.3

Design for simplicity by following these rules:

  • Make the common case awesome and the advanced case possible: keep advanced options available without burdening typical users. section 1.4.3
  • Prefer dedicated methods over unrelated functionality hidden inside another operation. section 1.4.3
  • Balance simplicity against excessive choice; highly granular versioning can overwhelm users and force unwanted historical changes into each selection. section 24.4.1
Listing 1.3 Translating text to a target language (the common case)
function translateText(inputText: string, 
                       targetLanguage: string, 
                       modelId?: string): string {
  return TranslateApi.TranslateText({
    text: inputText,
    targetLanguage: targetLanguage,
    modelId: modelId,
  });
}

A translation helper keeps targetLanguage as the common-case input while making modelId optional for advanced control. section 1.4.3

How API Design Patterns covers it

How deep it goes
Contrasts RPC minimization, focused methods, advanced options, and versioning choices without specifying implementation internals.
Examples
Uses ExecuteAction(), DetectLanguage(), translation models, optional modelId, and highly granular version choices.
What it assumes
Assumes familiarity with APIs, RPCs, methods, resources, and backward compatibility.
What you can do after
Evaluate API designs for hidden configuration, misplaced functionality, unnecessary choice, and burdensome advanced options.
How it connects
Connects API design with RPCs, usability, versioning, backward compatibility, and translation APIs.

Also explained in

Compare how 4 books explain simplicity →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of API Design Patterns. The section links point to the parts of the book it draws on.