5. The Point-Extent Pattern for Pairs of Numeric Types
5.1. Non-additive numeric types
5.1.1. Our first non-additive type: Date
Second only to amounts of money, dates are the most common data in commercial applications. Therefore, for business software, as well as many other applications, we certainly need a
As soon as we start looking at binary arithmetic operators, we see that the additive pattern we exploited in the previous chapter is inapplicable.
What is the sum of two dates? What do we get by adding July 4, 1776, to December 7, 1941? Obviously, that sum is nonsense, and we’ll want to make it illegal.