roam/20210929115545-avoid_primitives.org

10 lines
348 B
Org Mode
Raw Permalink Normal View History

2021-09-29 16:21:01 +00:00
:PROPERTIES:
:ID: 63e60abc-66a7-478d-a272-45c0e7c99c32
:END:
#+title: Avoid primitives
Wrapper types keep types distinct, e.g. a customer id can be represented as an
=int=, but /is not/ an =int=. This makes the domain model clearer, and they
cannot be mixed up accidentally (e.g. mis-ordered parameters) as the type
checker will prevent it.