Friday, February 20, 2009

In the aggregation of all the code I write, some of it HAS to be correct and some of it, not so much so. Actually it's more of a spectrum from super mission critical to meh, who cares. Given the degree to which computers are working their way into everything we do, I'm sure that there is code out there now, the correctness of which has life or death consequences.

That's why I consider strongly typed compiled languages to be important. I want to be able to guarantee correctness at compile time, as much as is possible, for these types of applications. Yes, of course there's unit testing, or coverage testing, the idea being to cover as much of the use cases as possible, and there are strong arguments for testing before you write anything, but I consider that to be a back up to compiler verification. Unit testing can't possibly cover every scenario.

Suppose you, as a programmer, were held liable for what your software did. Could you possibly find a way to write any more code? Would your calling in life be at an end? If tomorrow, congress passed legislation making programmers liable, I believe we would find a way and that way would be through strong compilers, unit tests, and digital signatures, all of which we would be prepared to take to court.

No comments: