Of course, sometimes there is a reason for weird and convoluted code. Someone once told me of an occasion when a clever optimisation had spectacular and unforeseen circumstances. He'd been part of a team working on really optimised real-time embedded assembly code for a car engine-control system. They spent months lovingly crafting carefully-written, hand-optimised code to be burnt onto a chip and installed in a test car. And everything worked brilliantly.
Then the US wing of the company got to work modifying the system for the American market. Some manager noticed that the UK team hadn't been quite as aggressive as they might have been with the use of the sign bit in one of the registers, and fired off a really harsh memo to higher management on both sides of the Atlantic, slating the UK team for this oversight. This obscenely wasteful squandering of valuable bits was duly `corrected', and the system installed in a test car and sent off round the track.
I'm told that everything was fine up to 127 mph, at which point the car promptly flipped over on its back in a rather spectacular and aggravating manner - having abruptly decided that it was now travelling 128 mph in reverse.
no subject
Date: 2003-07-31 16:49 (UTC)Then the US wing of the company got to work modifying the system for the American market. Some manager noticed that the UK team hadn't been quite as aggressive as they might have been with the use of the sign bit in one of the registers, and fired off a really harsh memo to higher management on both sides of the Atlantic, slating the UK team for this oversight. This obscenely wasteful squandering of valuable bits was duly `corrected', and the system installed in a test car and sent off round the track.
I'm told that everything was fine up to 127 mph, at which point the car promptly flipped over on its back in a rather spectacular and aggravating manner - having abruptly decided that it was now travelling 128 mph in reverse.
nicholas