Article 5WCW9 CodeSOD: A Commentary on Military Force

CodeSOD: A Commentary on Military Force

by
Remy Porter
from The Daily WTF on (#5WCW9)

Once upon a time, Simon worked for a company making software for missile systems. This was serious work, with serious testing procedures, and important standards around documentation.

Shortly before a live-fire test of a missile system, Simon knew better than to make any code changes, but he did want to improve the documentation. Adding comments was pretty low risk, so he went ahead and did that. By the time he was done, the Turbo Pascal code that controlled the missile looked like this:

{ add demands for pitch, yaw and roll, y x and z for this duty cycle }phidem := phidem + phidemc;psidem := psidem + psidemc;rdem := rdem + rdemc / 2; { NOTE: ROLL THRUSTERS MORE EFFICIENT THAN EXPECTED, CUT IT IN HALFzcdem := zcdem + zdemt[q]; { Add gravity over predicted velocity, from the table }ycdem := ycdem + ydemc;xcdem := xcdem + xdemc;

Specifically, it was the "magic number" of 2 that Simon wanted to explain. There was just one problem: he didn't terminate his comment. So the comment continued until the next }.

When the missile launched, it erupted from the tube, and then traced a perfect parabola into the dirt five meters in front of the launch tube.

It's unclear which was louder: the "thunk" sound of the missile striking the ground or Simon shouting an expletive when he realized his mistake.

proget-icon.png [Advertisement] Keep the plebs out of prod. Restrict NuGet feed privileges with ProGet. Learn more. TheDailyWtf?d=yIl2AUoC8zA
External Content
Source RSS or Atom Feed
Feed Location http://syndication.thedailywtf.com/TheDailyWtf
Feed Title The Daily WTF
Feed Link http://thedailywtf.com/
Reply 0 comments