An anonymous guest post at Hector Drummond’s blog pivots on the disturbing quote in the headline from one of the key advisors to the British government on the Wuhan Coronavirus epidemic:
To say I was gobsmacked at his admission is an understatement. He’s one of the experts advising the government about the Covid-19 pandemic, and was consulted in previous health crises such as Foot & Mouth disease. Like the approach to combating that, we’re seeing a kind of scorched earth approach to containing another transmissible disease.
Even though the “C” programming language that Ferguson used is nearly 50 years old, the language chosen isn’t the problem. Undocumented means that modules and other code fragments are not commented, so their purpose may be unclear to someone unfamiliar with the code. In the worst case it means that modules and variables don’t have self-documenting names. For example, an accounting program could have the variables
BalanceBroughtForward
andBalanceCarriedForward
, but a sloppy programmer might call themB1
andB2
instead – a sure recipe for confusion.The “C” language is good to work with but has some inherent issues which can lead to subtle bugs affecting the output without causing an error. A common problem is the conditional which uses two equals signs rather than one.
To compare variables
A
andB
for equality you would write this:if (A == B)
. However, it’s easy to accidentally write this:if (A = B)
. The latter always returns true and assigns the value of variableB
toA
. I have no idea whether Ferguson’s code contains any bugs, this is just one minor example of the need for strict testing.The reason for commenting code extensively and properly is so that the programmer himself, and anyone else who maintains it, can understand what it does and how it works, reduce the chance of mistakes and avoid unnecessary effort. During my IT career I would have terminated the contract of any contractor working for me who wrote thousands of lines of undocumented code. Not only is such code a nightmare for others to work on, it can be difficult for the original programmer to maintain if coming back to it after a long time. Sloppiness in the coding raises the worry of a concomitant lack of rigour in testing, although that’s not to assert Ferguson’s code isn’t working as intended and/or wasn’t tested.