What inherited code has impressed or inspired you? -


I have complained about the heritage projects that we have to work with developers in the last few years. The WTF site has many examples, which I really like my breath "WTF?" Do you bother under

But none of these is actually presented with code that had let you go, "Holy Crap It was well thought out!" "Wow, I never thought so!"

Did you have to work with the code you inherited from which you smiled and why?

Long ago, I was responsible for the Turbo C / C + Run-time library. Tanz Bennett wrote the original 80x87 floating point emulator in the 16-bit codel. I did not see closely in the code of Tan because it has worked well and there is no need to pay attention. But we were taking steps for 32-bits and the work fell to me to spread the emulator.

If programming could be said to be something similar to art, then it was like this.

The original math functions of the Tanz managed to maintain a temporary result of 80-bit floating point in five 16-bit registers without saving and restoring memory. The X86 assembly programmers will understand what this achievement was. The register position was rare and the five registers had to look at a beautiful site to do complex math simultaneously while keeping it in its temporary form.

If this is only a case of crafty coding which would be enough to qualify it as art, it was more than that Tanja carefully selected the underlying math algorithm which was kept temporarily in the registers To be the most suitable. The result was that at a high speed, floating point emulator was an important selling point for many of our customers.

By the time that came with 386 people who did not care about the floating point display emulator but we had to support Intel's 386 SX so that the emulator needs overhaul. I repeated the command-decode argument and exception handling, but left the main mathematical tasks completely untouched.


Comments