option type
An option type represents a value that may be absent.
Use this when Missing data is represented by a misleading default value.
without the term
“We use empty string to mean 'no middle name' and also 'not loaded yet', and zero means both 'free' and 'unknown price'. Can you represent missing values properly?”
with the term · How do you ask a model for option type?
Represent this possibly missing value with an option type. Test present and absent cases, and model patch-field presence separately from a nullable value.
What is option type?
A type that is either Some(value) or None, like Rust's Option or Haskell's Maybe. The compiler makes callers handle the missing case.
Why does option type matter when vibe coding?
Replacing absence with an empty string can erase a meaningful distinction.
How do you do option type?
Keep optionality at the boundary where it exists and handle it before requiring a value.
What goes wrong with option type?
Assuming one optional value automatically represents absent, null, and empty as three distinct states.