A recent leak of portions (about 15%) of the source code for Windows 2000 shows that Microsoft OS programmers are no more disciplined in their code comments — or considering of who might eventually see them — than any other programmer. Looking at the comments shows some typical bits of programmer humor scattered here and there.
In the struggle to meet deadlines, I think pretty much all programmers have put in comments they might later regret, including swearwords and acerbic comments about other code or requirements. Also, any conscientious coder will put in prominent comments warning others about the trickier parts of the code. Comments like “UGLY TERRIBLE HACK” tend to indicate good code rather than bad: in bad code ugly terrible hacks are considered par for the course. It would therefore be both hypocritical and meaningless to go through the comments looking for embarrassments. But also fun, so let’s go.
Curse words: there are a dozen or so “fucks” and “shits”, and hundreds of “craps”. Some dissatisfaction with the compiler is expressed in private\shell\shell32\util.cpp:
// the fucking alpha cpp compiler seems to fuck up the goddam type “LPITEMIDLIST”, so to work
// around the fucking peice of shit compiler we pass the last param as an void *instead of a LPITEMIDLIST
Other amusing bits abound. But, in summary:
In short, there is nothing really surprising in this leak. Microsoft does not steal open-source code. Their older code is flaky, their modern code excellent. Their programmers are skilled and enthusiastic. Problems are generally due to a trade-off of current quality against vast hardware, software and backward compatibility.
Interesting. And (as a former code commentator myself) amusing.
(via GeekPress)