Naming Things in Elm
summary
Claim: good names cut cognitive load by aligning code with working memory limits (about two to nine items, peak around four). Tools demonstrated: rename pipeline functions into narrative verbs (completeAssignment), give anonymous args clear names, collapse trivial wrappers after naming, prefer records to ordered tuples for arguments, and use tuples only when the shape is idiomatic and repeated (update returns (Model, Cmd Msg)). A broken example is renamed from filterGradeFiveStudents to fifth graders in class, which clarifies intent and fixes mental-model gaps.
AI-written summary · about
chapters (12)
- 0:00Introduction to naming importance
- 1:00Brain’s working memory limits
- 3:50Why good names matter
- 5:38Guiding principles for naming
- 7:22Mental models in code
- 9:51Extended metaphors in naming
- 10:53Anonymous functions pitfalls
- 12:16Filtering function clarity
- 14:43Tuples vs records in Elm
- 16:48Records for argument safety
- 17:30Tools for better naming
- 18:13Q&A
