by Smaug123 · 2y ago · 0 comments
To be pedantic, "date of birth" does not actually imply "age". At the very least you need "instant of birth" instead, since dates are subject to calendars and time zones. Also Feb 30th happened in 1712 in Sweden; beware of modelling a domain so tightly that you leave some of it unmodelled (cough email-address validation regexes).
September 1752 was even stranger, with 11 missing days:
> The Gregorian calendar reform was adopted by the Kingdom of Great Britain, including its possessions in North America (later to become eastern USA and Canada), in September 1752. As a result, the September 1752 cal shows the adjusted days missing. This month was the official (British) adoption of the Gregorian calendar from the previously used Julian calendar. This has been documented in the man pages for Sun Solaris as follows. "An unusual calendar is printed for September 1752. That is the month when 11 days were skipped to make up for lack of leap year adjustments.
$ cal 9 1752
September 1752
S M Tu W Th F S
1 2 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
https://en.wikipedia.org/wiki/Cal_(command)#Quirks_(1752)https://www.cs.rice.edu/~javaplt/411/23-spring/NewReadings/f...
In many cases the only feasible way to model the domain with types is to cut the scope as much as possible.