|
|
|
|
|
by mabbo
998 days ago
|
|
This is secretly about Types and misuse of values. "NV" is a valid value for a plate. The officers were using that value to indicate an error, thus the chaos of error handling for a non-error. When programming error cases, you should return something that cannot be a valid value. Excellent patterns exist in some languages where a sum type of either a return value or an error can be returned. Optional/Maybe monads to indicate something or nothing. Even, god forgive me for saying this, throwing an Exception is a good way to say "No, not a valid return value". The traffic wardens paperwork/app needs an explicit field for "Not visible"- ideally one easier to use than writing "NV", rather than a free-form text field that lets them write a value that only they know means something other than a real value. |
|