Re:Bruce Eckel: Strong Typing vs. Strong Testing (2003)
by kenjackson on Wednesday September 22, 2010 @08:39PM
(#1718110)
So this is one of those things where language features and language culture play a role (like unit testing in Ruby).
In Ada, you attempt to capture the assumptions in either the type of the name of the type. In general, you don't ever use primitive types directly. If you're going to use integer types questions you, for example ask, what are the assumptions? Is the range of integer values from 1-100? If so, then you make an integer type of that range. When you say "50", it's "50 what"? "50 decibals", "50 meters", "50 days"? So then you have types with these names.
If they followed standard Ada dev practice this bug would have probably been obvious. Probably less obvious in standard practice for many, if not most, other languages.
It seems like it'd be great if the type system had caught that, but if they expected all software to be using SI units they may not have seen the necessity for it even if they were working in a language which permitted that kind of thing.