LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1165|回复: 1

win2k 源碼的註解??M粗口~

[复制链接]
发表于 2004-2-27 16:07:17 | 显示全部楼层 |阅读模式
http://www.kuro5hin.org/story/2004/2/15/71552/7795


Embarrassments
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

Some insight into Microsoft's famous daily build process is given in private\windows\media\avi\verinfo.16\verinfo.h:

     *       !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
     *       !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
     * !!!!!!!IF YOU CHANGE TABS TO SPACES, YOU WILL BE KILLED!!!!!!!
     *       !!!!!!!!!!!!!!DOING SO FUCKS THE BUILD PROCESS!!!!!!!!!!!!!!!!
     *       !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
     *       !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

There are also various references to idiots and morons, some external, some within Microsoft. The file private\ntos\rtl\heap.c, which dates from 1989, tells us

    // The specific idiot in this case is Office95, which likes
    // to free a random pointer when you start Word95 from a desktop
    // shortcut.

The file private\ntos\w32\ntuser\kernel\swp.c from 11-Jul-1991 points at

    * for idiots like MS-Access 2.0 who SetWindowPos( SWP_BOZO
    * and blow away themselves on the shell, then lets
    * just ignore their plea to be removed from the tray

Morons also abound, as in this selection

    private\genx\shell\inc\prsht.w:
    // we are such morons. Wiz97 underwent a redesign between IE4 and IE5

    private\shell\ext\ftp\ftpdrop.cpp:
    We have to do this only because Exchange is a moron.

    private\shell\shdoc401\unicpp\desktop.cpp:
    // We are morons. We changed the IDeskTray interface between IE4

    private\shell\browseui\itbar.cpp:
    // should be fixed in the apps themselves. Morons!

Microsoft programmers also take their duty to warn others seriously. There are over 4,000 references to "hacks", mostly warnings. These include

    private\inet\mshtml\src\core\cdbase\baseprop.cxx:
    // HACK! HACK! HACK! (MohanB) In order to fix #64710 at this very late

    private\inet\mshtml\src\core\cdutil\genutil.cxx:
    // HACK HACK HACK. REMOVE THIS ONCE MARLETT IS AROUND

    private\inet\mshtml\src\other\moniker\resprot.cxx:
    // <HACK>
    goto EndHack;
    // </HACK>

    private\inet\mshtml\src\site\layout\flowlyt.cxx:
    // God, I hate this hack ...

    private\inet\wininet\urlcache\cachecfg.cxx:
    // Dumb hack for back compat. *sigh*

    private\inet\wininet\urlcache\filemgr.cxx:
    // ACHTUNG!!! this is a special hack for IBM antivirus software

    private\ispu\pkitrust\trustui\acuictl.cpp:
    // HACK ALERT, believe it or not there is no way to get the height of the current
    // HACK ON TOP OF HACK ALERT,

    private\ntos\udfs\devctrl.c:
    // Add the hack-o-ramma to fix formats.

    private\shell\shdoc401\unicpp\sendto.cpp:
    // Mondo hackitude-o-rama.

    private\ntos\w32\ntcon\server\link.c:
    // HUGE, HUGE hack-o-rama to get NTSD started on this process!

    private\ntos\w32\ntuser\client\dlgmgr.c:
    // HACK OF DEATH:

    private\shell\lib\util.cpp:
    // TERRIBLE HORRIBLE NO GOOD VERY BAD HACK

    private\ntos\w32\ntuser\client\nt6\user.h:
    * The magnitude of this hack compares favorably with that of the national debt.

While surprisingly informal, there are limits to how far the programmers go. There are no derogatory references to Microsoft or Windows themselves. Bill Gates is never mentioned. There are no racist or homophobic slurs. I saw only one drug reference.

    private\shell\ext\tweakui\genthunk.c:
    * CallProc32W is insane. It's a variadic function that uses
    * the pascal calling convention. (It probably makes more sense
    * when you're stoned.)
发表于 2004-2-27 17:37:03 | 显示全部楼层
真的嗎? 沒有被改動過吧??
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表