3 ms·
> ... most of the 25 top software errors don't look like type errors to me.... First off, most of the 25 top software errors aren't actually _programming_ erro
by yawaramin 12y ago
> ... most of the 25 top software errors don't look like type errors to me....
First off, most of the 25 top software errors aren't actually _programming_ errors. There's nothing any programming language, whether static or dynamic, can do to help you with them. So that's really a red herring.
Secondly, look again. At least two of the top 25 _are_ actually type errors:
CWE-134 Uncontrolled format string: this goes away if you constrain the input to be a discriminated union type instead of a plain string.
CWE-190 Integer overflow or wraparound: this goes away if you use an integer type which _can't_ wrap around. In fact, they almost come out and suggest exactly this in the details:
> Use a language that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid.
>
> If possible, choose a language or compiler that performs automatic bounds checking.