122 Comments
- imightbewrong, on 10/12/2007, -11/+182* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* !!!!!!!IF YOU CHANGE TABS TO SPACES, YOU WILL BE KILLED!!!!!!!
* !!!!!!!!!!!!!!DOING SO ***** THE BUILD PROCESS!!!!!!!!!!!!!!!!
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
lol - greyghost487, on 10/22/2007, -1/+100Its a thing us programmers need to be careful with, on a project i managed, one of our coders swore ALOT in the Java exceptions, Like "WORK you BITCH!!" and "Give me a ***** number JAVA!!", well after we were having issues once it was already in production, we had all exceptions throw a Dialog box out at the user, needless to say the office girls were not to impressed when boxes were popping up saying "Work You BITCH!"
WARNING: Comments and exceptions used for troubleshooting may not just be seen by you or you fellow coders!!! - inactive, on 10/12/2007, -6/+95I like how the spacing doesn't line up in that block. Looks like somebody actually changed the tab to a space on that one line.
- tizz66, on 10/12/2007, -1/+85No you aren't, you're buying the compiled version.
- lubos, on 10/22/2007, -11/+76Windows is a huge mess of hacks. However reliable hacks.
It's amazing how much work these people at microsoft are putting into backwards-compatibility. I wish Linux and MacOS developers would care about backwards-compatibility a bit more too. - uownedge, on 10/22/2007, -4/+69This is outstanding! I can just picture Samir from Office Space writing these comments.
"This code is a *****!"
Although Microsoft probably wasn't happy about it at the time, I'm glad this code did get leaked to give "the internet" some perspective on a few things (like the quality of the Windows Source code, legitimacy, etc). Windows may be a mess, but Microsoft has some severely talented programmers, and it's really not all bad. Their biggest downfall is their security model, and their stubbornness with the mindset that "The Microsoft way is the only way", which, really, you can't just pin on programmers. It's what their higher-ups told them to do. - geminitojanus, on 10/12/2007, -6/+53Well, Mac OS X takes it a bit further than that; because it's such a new OS (in terms of developer-years, not in terms of years), its API hasn't yet had a chance to become very stable, and features keep coming from every corner Apple can stuff them into, and bugs are actually FIXED and the developer's who rely on those bugs are simply notified when their program stops working on the new API set that this is so.
In Windows, the API was one thing that was held sacred; no developer EVER changed the old functionality of an API, and new ones were simply implemented next to it (and it was up to the developer to know to move to the newer API and let the old one go). The problem is that Microsoft did a TERRIBLE job in depreciating these older APIs, as more and more began to pile up on each other and replicate the same exact functionality, over and over again. Now Windows is a terrible hack with 19 ways to do something, and no real "right way", simply because Microsoft never stood up and said "THIS IS THE WRONG WAY, STOP DOING IT, STOP DOING IT OR YOUR SOFTWARE WILL STOP WORKING TOMORROW."
Both ways are technically incorrect. APIs should be considered sacred, but changes to APIs MUST be allowed to happen, but they must be allowed to happen in a way that developers can cope with, rather than chew up their hats, cash in their chips and walk away from the platform. APIs also MUST be depreciated and removed from products once they are old and not expected to operate anymore, and the developers have been given more than ample time to move their code away from these APIs.
Apple's smaller codebase (and the codebase of people who write software for Apple) has simply had less time to mature, less time to stay stagnant, and for the most part has been tracking a live target for the past 5 years. This has kept the platform very agile, but it has also kept developers very exhausted, and very vocal at this point (which is why Apple's slowing down the changes to the older APIs, and why most Tiger apps should continue to work under Leopard without too much patching).
Microsoft's HUGE codebase (and the codebase of the people who write software for Microsoft's OS) has had so much time to mature, it's stagnant. Changes to the API make developers FURIOUS, and breaks hundreds upon hundreds of applications, many of which the developers simply refuse to fix, which causes the old API to stick around. Instead of having one or two different ways to draw and maintain a window in Windows, we now have at least 4 (previously Win16's CAPI, Win32's CAPI, MFCs, prevously ATL, now WTL, .NET 2.x, Visual Basic 6's (and previous) method, and soon to have WinFX aka .NET 3.0; contrast with Mac OS X's Carbon or Cocoa; Contrast with Free Software's main UI Libraries GTK+ and Qt), and at least three different ways to share data and objects between applications (DDE, OLE, (D)COM). Within all of those APIs, are VERSIONS of those APIs, which Windows can't simply get rid of because of having programs linked to older and newer versions of the same API (for example, the Win32 MFC API has mfc- 42.dll, 70.dll, 71.dll, and 82.dll around to support Visual C++ 6, Visual C++ .NET 2002, Visual C++ .NET 2003, and Visual C++ 2005 (respectively) compiled applications). Interestingly, the only place where Microsoft hasn't done so bad with this bloat is with the API subset DirectX, and maintaining very strict versioning and depreciation concepts here, which is perhaps one of the reasons game development remains very strong on Windows.
I won't get into Linux here, because quite frankly, there are a million ways to do everything, but as a rule, all of the millions aren't distributed to you all at once, and there really isn't a "right" way, just a "popular" way, which is one of the reasons why Linux is such a departure from the above two operating systems, both in terms of usability and functionality. However, in many ways, it exemplifies both what is right about the above to platforms, and what is wrong about both platforms (especially the latter, but that's one of the parts that makes it fun for the developer, finding ways to improve).
To be truthful, if I were Microsoft, I would freeze the platform at Windows XP, and kill support for _EVERYTHING_ prior to it, including NT- and 2000- specific APIs. 6 years is long enough for all of the developers to catch up to the platform, and it makes a very sturdy, stable launching point for a new OS, which should have been Vista, but isn't. Getting rid of the old code is the only way Microsoft's ever going to rid themselves of the stigma of being Microsoft, and Microsoft has yet to show commitment for this sticking point. Instead, if you were to go an open a random Windows source file, you're still going to find hacks like "//Note: this is here to support Excel 95", even though its been 11 years since it was new. - Hickeroar, on 10/12/2007, -0/+39Two of my favs:
privateshelllibutil.cpp:
// TERRIBLE HORRIBLE NO GOOD VERY BAD HACK
privatentosw32ntuserclientnt6user.h:
* The magnitude of this hack compares favorably with that of the national debt. - flave, on 10/12/2007, -1/+38You think the developers for OSX don't swear in their code either? Every coder runs into problems and it's only normal to vent frustration into comments in the code. Every single piece of code I've ever seen has had visible frustration written into it.
Hell, me and my friends used to check each other's programs for things that could get us in trouble back when we took compsci courses. This is not a "problem" specific to windows. - SenatorPenguin, on 10/12/2007, -3/+36Do you have any idea how much longer it would take to develop anything, especially something as large as Windows without using comments that say what they mean? Microsoft knows that they have great developers (which they do) and they don't strangle them with insane code standards. It appears that Windows 2000 is excellent code, and it is a great OS if you look at what Microsoft released before it (ME)
- Ahnteis, on 10/12/2007, -5/+37>>invader
You may want to check the article to see what he's talking about. - cyssero, on 04/18/2009, -2/+34But this is what so many people like about MacOS, it's lack of native backward compatibility (unless of course through Classic).
Windows supports so many billions of hardware configurations, and equally as many software apps, from early days right up until now.
As the article said, it's a trade off. Backwards compatibility is always nice, but it can lead to unstable code. The problem with Windows is that there are so many people still using dated software. If Microsoft were to ditch support for all of those, it would prove to be a very unsuccessful move.
Well, you can't impress them all, hey? - inactive, on 10/22/2007, -0/+31Comments don't get compiled!!! They didn't write the damn thing in perl.
- Ahnteis, on 10/22/2007, -4/+35Have none of you ever seen code before? This is absolutely normal.
- inactive, on 10/22/2007, -3/+33it's only 10:30, most of the macsters are still asleep...and linux people aren't stupid enough to complain about comments in code.
- invader, on 10/12/2007, -2/+29not really different from any other large project's source code... anyone remember an interview with a CEO or CIO that had his company switch to openBSD because he saw "does this go here?" in the linux distro the company was using
- saralk, on 10/12/2007, -2/+28I'm sure that when you are burning the midnight oil trying to meet a deadline and after 2 hours of constant debugging, tracing ridiculous amounts of information just to find the source of one bug, then you realise its because another application is mucking it up, you would be just a bit cranky.
- inactive, on 10/12/2007, -2/+24I take it you aren't a developer.
- inactive, on 10/12/2007, -2/+21nrbelex, did you find this discussion by stumbling outside the borders of Digg's politics section? You clearly don't know what the hell you're talking about and are trying to look for things to be outraged at even when those things don't exist in the way you think they do.
I suggest you spend the time to learn about something before getting outraged at things you don't understand. - invader, on 10/12/2007, -2/+21any comment is better than no comment, even if it's venting frustration
the person reading your rant will have a better idea of what he/she is getting into - DeadWisdom, on 10/12/2007, -4/+22Er, I question more the practice of outputting comments as exceptions rather than swearing in comments.
- ricepudd, on 10/12/2007, -2/+19Interesting read, but I wouldn't go as far as saying "Hilarious"! Just goes to show that Microsoft programmers are indeed human and have some freedom of expression!
- Portside, on 10/12/2007, -7/+24Amusing article.
- MaTT56, on 10/12/2007, -9/+25Never seen this before, so +dig
- inactive, on 10/12/2007, -1/+17"digg does not use a fixed-width font"
but THE ARTICLE DOES! (at least for the block I'm talking about). They *do* line up in the comment above because HTML doesn't show gratuitous whitespace. Go RTFA.
Man, idiots are fun. - ImOscar, on 10/12/2007, -3/+18I understand censoring words if you are quoting something and don't want to curse. But when you just tried to use the word yourself don't hold back. *****.
- Jugalator, on 10/12/2007, -3/+18"btw, i did rtfa."
Then you should see where the monospacing also didn't line things up, and why he was modded down. Yes, I'm talking about that single line. It has nothing to do with variable type fonts. Well, that leads to even more mess, of course, but not what's spoken of. - pathy, on 10/12/2007, -3/+17No Haikus? =(
- fogbog293, on 02/10/2009, -2/+16If you RTFA, you'd notice one line of the tabbing comment was out of place
- hurfydurfur, on 10/12/2007, -3/+16Daza hits it on the head. Backwards compatibility is a trade off. Looking in the rear-view mirror while driving makes you drive very slowly forward. Virtualization could fix this though (even more so than Mac's classic workaround).
- NinjAlt, on 10/12/2007, -1/+14I'm sorry, but my side is hurting from seeing the mental image of some poor secretary having a popup calling her a bitch and telling her to work.
- mbthompson, on 10/22/2007, -2/+14privatentosw32ntuserclientnt6user.h:
* The magnitude of this hack compares favorably with that of the national debt.
LOL
First time I've ever seen this article. Good find. dugg - catoutfit, on 10/12/2007, -8/+19nrblex, you've obviously never coded anything then? Even this page has comments.
Also 'WE' are not 'paying' for these comments, not everyone uses Windows mate...Sorry :( - xJVz, on 10/12/2007, -1/+12Dude, all programmers cuss a lot in their code. For example, the MPlayer source code (most current):
rgrep -Ew '(*****|*****|damn|dammit|bitch)' * | grep -v '.svn' | wc -l
16
Sure, it's only 16, but that sounds about right. Things like "case FCC('J','U','N','K'): // official *****" are common. - gharding, on 10/12/2007, -3/+13What the hell kind of code review gives two ***** about curse words comments? Conservative Christian Software Development, Inc. maybe, but not Microsoft (or any other large closed-source company).
- MacSuxWindozSux, on 10/12/2007, -2/+11No the hacks are there because Windows is an insanely huge platform. A lot of those hacks are meant to fix, or maintain compatibility with someone elses code either in Microsoft or another leading software firm.
If you had to fix a security or compatibility problem with your program interfacing with someone elses program, and you didn't have access to change their code, what would you do? Complain? And in the mean time?
Microsoft makes a temporary fix and marks it as temporary. "" - zackz, on 10/12/2007, -8/+17I wonder what they use to build...so that I don't end up using that inadvertantly
- evilTak, on 10/12/2007, -4/+12"The security risks from this code appear to be low. Microsoft do appear to be checking for buffer overruns in the obvious places. The amount of networking code here is small enough for Microsoft to easily check for any vulnerabilities that might be revealed: it's the big applications that pose more of a risk. This code is also nearly four years old: any obvious problems should be patched by now."
Funniest part of the whole article... - hurfydurfur, on 10/12/2007, -1/+9Comments are absolutely needed for readability/documentation, even in scripting. So much so that many languages have various commenting features as an integral part of the syntax.
- darklox, on 10/12/2007, -5/+13While this is ancient history (2004), it is still fun to read for both programming and non-programming geeks alike.
- kimos, on 10/12/2007, -5/+12Interesting...
Digg, but the guy didn't do much more than play with grep and a bunch of stolen source code. Some of the lines he found were half sentences since he just patern matched words like 'hack' that he was interested in. - vafada, on 10/12/2007, -1/+8@nrbelex
as far as i know... then a source code is compiled.. the comments aren't included in the compiled binary.. so you are not paying for comments :P - inactive, on 10/12/2007, -4/+11I've wanted to write comments like this in my code forever, but then they'd be the ONLY comments i there and people might get a little upset.
- indicas, on 10/12/2007, -2/+9That's a lot more effort than most of the digg articles require on here
- ramd3z, on 10/12/2007, -4/+11"It's been widely rumored for a while that Microsoft relies on stolen open source code."
"Searching the code for "linux" and "GPL" finds no references."
I really wouldn't expect them to be that stupid. One doesn't need college to master find and replace. - jonj, on 10/12/2007, -0/+6anyone who has gone thru a MS interview will attest to the fact that they only hire smart people.
- LinuxConvert, on 10/12/2007, -1/+7A comparison to linux kernel hacks :P
~/downloads/linux-2.6.18/arch/i386/kernel$ rgrep hack *
apm.c: * Add hack to allow power off of SMP systems by popular request.
apm.c: * Changed to use the sysrq-register hack for registering the
cpu/common.c:/* This is hacky. :)
cpu/common.c: * This is a horrible hack to allocate the GDT. The problem
io_apic.c: * This looks a bit hackish but it's about the only one way of sending
io_apic.c: * is so screwy. Thanks to Brian Perkins for testing/hacking this beast
sys_i386.c: version = call >> 16; /* hack for backward compatibility */
The only difference is that the linux devs KNOW that their code will be open for public viewing where as the windows ones always thought their comments would remain locked up with the source forever. I guess they were wrong
Btw, to all those who say that you're buying Windows and are getting this stuff - nope you're not, the compiler doesn't compile comments! - peorth, on 10/12/2007, -2/+8Old, but I'll digg it just for this:
privateshelllibutil.cpp:
// TERRIBLE HORRIBLE NO GOOD VERY BAD HACK - hmemcpy, on 10/12/2007, -5/+11@geminitojanus
Solid gold! Agree with every word! +digg - misterjangles, on 10/12/2007, -0/+6If you consider that you're paying for these comments, then I would say that you are fully getting your money's worth. For one thing, comments are absolutely necessary in programming. But, if they can occasionally be done with a bit of humor, all the better.
It's no different than throwing a little personality into an otherwise dry business email. It get's people attention, sticks in their memory and just basically makes the job a little bit more enjoyable. -
Show 51 - 100 of 122 discussions

What is Digg?