67. Generics: design and compromise (pocket version)
TL;DR (5 lines)
- Generics justify themselves through reusable contracts.
- The reader should see the gain, not only the syntax.
- A tiny but real reusable helper is the best teaching unit.
- Malformed abstractions fail at the contract boundary.
- Use abstraction when it clarifies, not when it decorates.
Concrete Problem
Generic pages often show parameter syntax without explaining why a reusable contract is worth the extra abstraction.
Coherent example
space demo/generics
proc identity[T](value: T) -> T {
give value
}
Global explanation
A generics chapter should answer one question: what reuse is being bought by the abstraction? If that answer is weak, the generic surface is probably too abstract for the reader and the code.
Short exercise
Add one second generic procedure that reuses the same abstraction for a clearly different value shape.
Next best action
Keep the example small, reproduce it locally, then continue to the full chapter if you need the broader context.