From Stroustrup's "Programming: Principles and Practice Using C++", c.2014:
What are types good for?Types are good for directly representing ideas into code.
________________________________________________________
An aside: I am not sure if Bjarne Stroustrup realizes how profound this statement is to a man with deep philosophical tendencies. This statement, that
types are good for directly representing ideas into code, could be a mantra, and becomes even
deeper when applied to mathematical phenomena.
Consider the user-defined type, the class
Fraction. Developing this type helps me to express the "idea," the Qualita Occulta ?, of rational numbers and how to "operate" with them as "numerical structures" consisting of defined members, specifically, two "Integers," the Numerator and the Denominator, and on and on, et cetera.