What does Ada do that helps with this in ways C and other languages don't?
What does Ada do that helps with this in ways C and other languages don't?
https://en.wikibooks.org/wiki/Ada_Programming/Contract_Based...
Also, the type system lets you specify legal values with more precision than the word-based types that most languages inherited from C. For example, you can have range types that may hold integers of only a certain range, and the compiler will enforce that when assigning to variables of the type, or throw an exception if an arithmetic operation results in a value outside the range (you also have modulus types that explicitly give the wraparound behavior familiar in C). Containers allow generic constraints, and you can explicitly specify the dimensions of array types.