Slashdot is powered by your submissions, so send in your scoop

 



Forgot your password?
typodupeerror
×
Windows Operating Systems Software IT

Why MS is Not Opening More Source Code 526

mario_grgic writes "Apparently inappropriate code comments is one of the reasons according to this story. I wonder what kind of things developers put in comments that would be so bad for the rest of us to see?"
This discussion has been archived. No new comments can be posted.

Why MS is Not Opening More Source Code

Comments Filter:
  • comments? (Score:5, Funny)

    by Anonymous Coward on Wednesday February 09, 2005 @09:12PM (#11625489)
    /* Nothing for you to see here. Please move along. */
    • by G-funk ( 22712 )
      I've got comments like that. Before some API code I didn't want other developers using (stupid java's lack of a friends keyword) I had this: /* This code isn't really here *waves hand mysteriously, dates supermodel */ .... nasty sql code .... /* mmmm, supermodel */

  • by rednip ( 186217 ) on Wednesday February 09, 2005 @09:12PM (#11625490) Journal
    • for a good time call June x12345
    • Linux rules!
    • It's like patching a Damn made of sawdust!
    • Man, this code sucks!
    • ToDo: this looks like a security hole (repeated 4689 times)
    • (got any more!)...
    • by Anonymous Coward on Wednesday February 09, 2005 @09:15PM (#11625512)
      I prefer to think the most inappropriate comment possible would be:

      GNU General Public License, version 2.0
    • Probably just a bunch of four-letter variables that would offend anyone older than 27....
    • by Anonymous Coward on Wednesday February 09, 2005 @09:17PM (#11625540)
      Cmon. UNIX comments are way funnier.

      My personal favorite:

      /* You are not expected to understand this. */
    • for a good time call June x12345

      i did, bitch didn't answer wtf !

    • Im sure there are alot of offensive 'Master' and 'Slave' comments in DOS too..
    • I could post may innapropriate comments in source code. In my youth one was: /* Go away Jeff XXXX. You do not understand this code even though you think you do. I'm tired of being forced to revert your changes to this file. */

      Unfortunatly many of the best ones have been in proprietary code that is still in use and would be recognized if posted here.
    • by Anonymous Coward
      I wonder if it is the 'inappropriate comments' or the 'inappropriate code'. Replacing the comments in code is easy but replacing the code is hard. Here is an example of what I mean (yes, a colleague actual did this once):

      public class JohnQPublic {
      public void GettinMyHo (int daBooty) { ...
      } ...
      }

      public class PimpDaddy{
      public GettinSome() {
      JohnQPublic johnDoe = new JohnQPublic();
      int inDaAss = 100;
      johnDoe.GettinMyHo(inDaAss); ...
      } ...
      }

      Except "John Doe" was usually people he didn'
    • grep -R chainsaw /usr/src/linux
    • I've seen
      ToDo: Make this work

      I laughed each time I saw it.
    • by Moraelin ( 679338 ) on Thursday February 10, 2005 @03:31AM (#11627693) Journal
      I doubt that anyone would place comments in code that basically boil down to "I hate my job and my employer." At the next code review, or the next time a bored coleague looks into your code, it's just begging to be used against you.

      If comments about the company or other co-workers are present, they'll more likely be a lot milder and kept to something you can sorta justify as just documenting code behaviour. E.g., "this is a work-around for Bug X in Function Y of the MSFC".

      On the other hand, there is plenty of room for utterly inapropriate comments about other companies and products. Think along the lines of "unlike the utter crap we took from the BSD monkeys, this one is 40 times faster and uses 10 times less memory." Or "this is here only because the monkeys from are too stupid to do their own buffer checking before calling my function."

      Excessive hubris is pretty much part of the job description for nerds. Remember kids, everyone else sucks and is an idiot luser. Only you can possibly know anything at all about computers. And only the skills you have (e.g., pushing the power button or typing "emerge kde") are l33t and cool, the rest is idiot luser stuff.

      But my guess is more like MS is just playing defensively. There are a lot of people and has-been companies that are out for MS's blood. Comments that noone minds in the Linux kernel, if found in MS code would get those people screaming for blood and gathering a proper medieval crowd with pitchforks and torches.

      I mean, look around. Even a comment as benign as "this is a work-around for bug X in function Y" would get half the MS-bashers on /. screaming and waving it around as definitive proof MS can only write bad code.

      Doubly so for those who:

      A) never wrote any productive code in their entire life, but think they're uber-l33t because they can run someone else's scripts (e.g., "emerge kde"), or

      B) wrote a 20 line program in BASIC once, or a 20 line BASH script, so they think they're qualified to pass judgment about 1,000,000 line projects or about whole languages

      (No offense intended to good programmers in either VB or various shell scripts. But there is a _massive_ and _fundamental_ difference between a 100 line program and a 100,000 line program. Stuff that works in the former, like, "bah, I wrote it just as well without all this fancy encapsulation and bogus design", might just cause the latter to never be finished or anywhere near working.)
  • grep (Score:5, Funny)

    by mmkkbb ( 816035 ) on Wednesday February 09, 2005 @09:13PM (#11625497) Homepage Journal
    /* The word 'fuck' is here so you can grep for it */
  • ha (Score:5, Interesting)

    by momerath2003 ( 606823 ) * on Wednesday February 09, 2005 @09:13PM (#11625500) Journal
    Heh, no surprises here. I mean, from what [slashdot.org] we've [slashdot.org] seen [slashdot.org] from the leaked windows source...
  • by jdray ( 645332 ) * on Wednesday February 09, 2005 @09:13PM (#11625501) Homepage Journal
    10 REM Linux rocks!!!
    20 Do(stuff);
  • I wonder... (Score:5, Funny)

    by PornMaster ( 749461 ) on Wednesday February 09, 2005 @09:13PM (#11625503) Homepage
    // horribly insecure, but we had to meet a ship date...
  • by kngthdn ( 820601 ) * on Wednesday February 09, 2005 @09:14PM (#11625508)
    ...

    /* Man I hate this fricking company */
    LineTo(hdc, LOWORD(lParam), HIWORD(lParam));
    ReleaseDC(hwnd, hdc);
    }

    fDraw = NULL;
    return 0L;

    /* Nobody reads this crappy code anyway */
    case WM_MOUSEMOVE:
    if (fDraw)
    {
    hdc = GetDC(hwnd_global);
    MoveToEx(hdc, ptPrevious.x, ptPrevious.y, NULL);
    LineTo(hdc, ptPrevious.x = LOWORD(lParam),

    /* I wish I could stick this at the top of the WndProc... */
    SendMessage(hwnd, WM_DESTROY, 0, 0);

    ...

  • by Duncan3 ( 10537 ) on Wednesday February 09, 2005 @09:15PM (#11625518) Homepage
    /* Copyright © 2000 Apple Computer, Inc. All rights reserved. */
  • lol (Score:2, Insightful)

    by Apreche ( 239272 )
    grep -ri fuck /usr/src/linux

    I just wouldn't be open source without inappropriate comments.
  • Hard habit to break. (Score:5, Interesting)

    by shotgunefx ( 239460 ) on Wednesday February 09, 2005 @09:16PM (#11625531) Journal
    I used to pepper my code with vulgarities. Then clients wanted copies on their own hosts. It's a hard habit to break.

    Particularly when debugging scripts. "F*CKING C*NT" and the like weren't to uncommon.

    An interesting tidbit, Viaweb (now Y! Store) used to have a program called storef*cker :)
    • by jbarket ( 530468 ) on Wednesday February 09, 2005 @10:19PM (#11625990)
      I had the exact same thought when I read the summary.

      A few years ago I was hired to do web application development because of my skills in one language, but I was hired to write in another. So, since I began doing for-production work in a matter of days, I had a lot of simple errors.

      I used to step through my code by placing either "Fuck yeah!" or "Shit's broke" inside and outside of different condition statements.

      Then one day some idiot on the team decided it would be a good idea to randomly show the clients my incomplete, not live code for whoknowswhy, and in the middle of the page at random was "SHIT!"

      Been trying hard to break that habit since :D
      • by slashrogue ( 775436 ) on Wednesday February 09, 2005 @11:11PM (#11626409)
        Been trying hard to break that habit since :D

        I hope you mean breaking that idiot of the habit of showing clients random and incomplete code ;)
      • by Anonymous Coward
        You only do it once.

        I _do_ recall when a particular demo for a big client was going well, I was actually calming down (big mistake), etc. A weird path through the code was taken and what do I see?

        ***Eat my flaming cock, you hairy scrap of shit clinging to the ass of a decent developer, You should never have hit this exception. Please eat the stack trace, curl up, have massive convusions, and beg me for your life. Bring.a bottle of good scotch. -grs#***

        Printed in big, red letters on the app. (We have c

    • by noidentity ( 188756 ) on Wednesday February 09, 2005 @11:43PM (#11626654)
      An interesting tidbit, Viaweb (now Y! Store) used to have a program called storef*cker :)

      Must have been a b*tch to invoke from the command line, with an asterisk in the name and all.
  • by mtrisk ( 770081 ) on Wednesday February 09, 2005 @09:16PM (#11625535) Journal
    /* Taken from the Linux Kernel 2.6 DO NOT RELEASE UNDER ANY CIRCUMSTANCES, VIRAL GPL WILL HARM US */

    /* No one from the Debian Project shall ever see the following, lest you want your head chopped off! */

    /* These Samba guys figured it out, here's what they wrote */

    In all reality though, it's probably littered with expletives, like the Win2000 source code leak was. [slashdot.org]
    • Re:How about this? (Score:5, Interesting)

      by ScrewMaster ( 602015 ) on Wednesday February 09, 2005 @09:51PM (#11625794)
      Yeah, well ... if you were a fresh-out-of-college coding grunt in a Microsoft sweat shop, believing that no-one would ever see your code but your co-workers and maybe your boss, you might be inclined to put some asinine comments in your code as well. That's not so surprising ... what is surprising is that those comments are still there. Which gives me an idea that maybe Microsoft doesn't run quite as tight as ship as they would like us to believe. Of course, we already knew that.
    • Re:How about this? (Score:3, Informative)

      by damiam ( 409504 )
      The w2k source wasn't littered with explitives. There were a few, but much less than I'd expected (fewer than in the Linux kernel, which contains fewer LOC).
  • by Anonymous Coward
    I am a delphi developer and often delve into the VCL source and the source of other third party components and these usually contain little or no comments which leads me to believe that the comments are automatically stripped out when the software is released to the world.

    So If Microsoft does this then there is one excuse down the drain, but how many more will there be?
  • Examples (Score:2, Funny)

    by apoch2001 ( 701484 )
    /** * * This method will cause system to crash and *fustrate users * */ /** * * This section of code will steal personal * information from users and give us blackmail * ability * */
  • a couple of regex's on a perl command line string could clean your entire codebase of comments in a couple seconds, well maybe a minute or two for MS code, but anyway, that isn't much of an excuse!!
    • A VC++ or VB user who can actually use another tool or programming language. Now that is a rarity.
      I've never even met a VC++ user who could even write C/C++ without the environment.

      I agree with your statement but, I'm not sure the target environment is up to it.
  • by mikael ( 484 ) on Wednesday February 09, 2005 @09:19PM (#11625562)
    what kind of things developers put in comments that would be so bad for the rest of us to see?"

    // I don't know what this value is for, but it seems to stop the BSOD from appearing

  • GPL (Score:2, Funny)

    by iMaple ( 769378 )
    /* This code is licensced under the GPL. Please read * the license carefully. Enjoy. */

    On the other this is impossible. I havent found any GPL code as bad as the MS code (Well of course I havn't looked at too many GPL programs and a single MS program :) )
  • by willCode4Beer.com ( 783783 ) on Wednesday February 09, 2005 @09:19PM (#11625565) Homepage Journal
    One of my previous employers got slammed in the press one day because a code error let a web server comment get leaked into the HTML comments of a page. It said something along the line of being a work around for the whinny mac people. I don't remember exactly but, it was pretty innocent. They got written up in quite a few Mac related news articles as being anti Apple (when they were actually trying to support it).

    OTOH, there could also be missing comments. I think we've all entered projects with no documentation or usable code comments; where the lore of the project is passed from dev to dev.

    Or, they may have rushed so many projects that they are embarrased for anyone to see the code. Many companies and the military are guilty of this. Maybe they want some time to do a review / refactor.
  • There are no less than a hundred apps and scripts to strip all comments from the source code. If there's anything preventing MS from releasing the source code, it's not the comments.
    • Microsoft Boss: "I'm sorry, but we can't let you use any open source utility at work."
      Microsoft Programmer: "Oh noes! I can't sed out the comments!"
      ---
      Microsoft Boss: "Wait a minute, what's with these comments? We can't release the source code now." (evil grin)
  • if: bloat

    then: bloat more
    while: bloat
    end: just kidding...add more bloat
    bloat
    bloat
    bloat
    end: clean code
    add: bloat
    //kill me now. the devil made me do it
  • Easy... (Score:5, Funny)

    by Epsillon ( 608775 ) on Wednesday February 09, 2005 @09:23PM (#11625599) Journal
    /* Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 The Regents of the University of California. All rights reserved. */

    And a little further down...

    /* It's our TCP/IP thingy. We're gonna patent it. We own the Internet and all it's (sic) protocols. Resistance is fu... is fut... is useless */

    ;-)
  • ///**This is Security Hole which will force them to upgrade to XP Pro**///

    ///**This is the best I could do ripping off the feature from OS X; it will have to do until the next rev. Damn tricky Apple bastards...**///

    ///**These are not the comments you are looking for.**///

    ///**I pulled this right out of the Linux 2.4 source code! They'll never know!**///

    ///**Adobe incompatability code enabler; see Screwing the Competition, Volume 23 for Documentation**///

    ///**Man, I'd never get away with this shoddy hack if it weren't for our illegal OS Monopoly! Being evil rules!**///

    ///**Hey, wait a minute! THERE'S where that SCO Source Code went to!**///

  • You've got to admit, it's a possibility.
  • // help! i'm being held captive in a coding sweatshop! kindly send help wery soon!
  • Every _GOOD_ programming book (at least the O'Reilly's) stress the fact that bad coding with good comments is better than clever coding without comments.

    We're talking about Microsoft here. I'd expect from them standards a bit higher than the average. What gives?

    "Shawn started a lively discussion. Certainly there are people inside of Microsoft discussing the pros and cons of doing this, but as far as I know, today, we have no plans to share the Windows Forms code,"
    With the given possibility I'm not surpr
  • This is pretty normal isn't it? I seem to remember that when part of the Windows source was stolen (also with HL2 I think) people posted some of the more interesting/colorful comments in the code to the web. So I'm not suprised to see this issue come up.

    That said, why not just strip the comments and release it that way untill the comments can be cleaned, or better yet run it through a program to filter out offensive language.

    I mean, it's not like the variables have naughty names, right?

  • A few years back, my company was interested in buying a component of our software in an OEM arrangement. We had a formalized code review meeting that spent three days on paper review of architecture and that sort of stuff

    The second part of the week was a code walkthrough highlighting certain parts of the tricky code. My software development manager, for some unknown reason, decided to leave in original comments from the developers which included
    - Dissatisfaction with a pay raise of only 22 percent
    - Disa
  • A coworker from my past lives once told me that he worked for a school district at New York some years back, where the PHB hired an idiot that can't code. Being a government job etc., it was rather difficult to get rid of the said person. So instead of letting the said person write code, they (as in two other coders) told the person to write comments for the code...
  • by Matt Perry ( 793115 ) <[moc.oohay] [ta] [45ttam.yrrep]> on Wednesday February 09, 2005 @09:37PM (#11625683)
    I like Philip Greenspun's take on inappropriate code comments [greenspun.com]. This paragraph stands out:
    Should one judge the author of this code, Cotton Seed,
    unprofessional because of his colorful source code (never visible to an end-user)? Or does he get credit for having made an honest effort to write a high-quality, useful piece of software and then giving it away for free, with source code so that others can build on his work?" And then further credit for calling attention to a potentially important issue with words that are unlikely to be overlooked?
    Personally, I feel that making your software freely available far outweighs any potentially shocking comments.
  • Any time that you move code from being closed to open you have to go through a long procedure reviewing the code and scrubbing it of things you don't want to or can't show. Microsoft is not alone in this. Anyone who intends to opensource code has to clean it first. You have to research all the licences to make sure you are not releasing someone elses code. And if there is code you can't release in there you have to either rewrite it or just cut that functionality. You have to scrub any comments that yo
    • /* The next three lines prevents the shell from running atop DR-DOS. */
    • /* This method does nothing except change Win32s enough to break application compatibility with OS/2 */
    • /* This is the file that permits our partners to install spyware on users machines */
    • /* A constant to permit the NSA to decrypt anything encrypted on a Windows machine. */
    • /* This function detects the user agent, and gives it preference if it's IE */
    • /* A random hex number generator for GPF error dialogs. */
    • /* This func
  • I think it is an issue that the comments give away companies future stradigy. //This checks to see if the underlining OS is PC Dos and stop running if it is. //Set flag to 1 to enable Linux compatibility //Set flag to 0 to decuple IE from the OS //This section is very insecure but they wanted this feature or I loose my job //This flag to 0 to disable backwards compatibility to DOS.
  • All the code is commented with: !seineew era sreenigne epacsteN
  • by 1000101 ( 584896 ) on Wednesday February 09, 2005 @09:52PM (#11625803)
    After reading some of the comments, I've come to realize that many people apparently use vulgar language and/or ridiculous comments in there code. Am I in the minority when it comes to not doing this? I really don't see the point actually. I don't like to comment anymore than the next guy, but when I do, it's usually there to help me out in the future (even if that's just tomorrow when I come back in to work). I would feel like an idiot reading my own code if it were riddled with comments like 'this fucking sucks!', or 'the front desk girl is so hot and has big tits!'.
  • Quake III (Score:5, Funny)

    by Neo_Ludite ( 858021 ) on Wednesday February 09, 2005 @09:57PM (#11625830)
    My favorite from the Quake III source
    i = 0x5f3759df - ( i >> 1 ); // what the fuck?
    • Re:Quake III (Score:5, Informative)

      by Vengie ( 533896 ) on Thursday February 10, 2005 @12:47AM (#11627030)
      that line is used to compute a "fast inverse square root" -- google for 0x5f3759df and you'll learn a little math. [you see that number once and you remember it forever] the result is a rough hack of what the exponent should be.

      -b
  • by Gildenstern ( 62439 ) on Wednesday February 09, 2005 @10:07PM (#11625900)
    The best comment I ever saw in a piece of code was from a friend that I was working on a group project with back in college. He sent me some of his work for the project and I was having problems getting it to work like he said it did so I was looking in the code and found

    /*Drunk, Fix this Shit Later*/

  • by Saint Stephen ( 19450 ) on Wednesday February 09, 2005 @10:11PM (#11625920) Homepage Journal
    The header to one of the DAO files in the Windows source tree said this when I read it (when I worked there). It said (paraphrasing): "Let me tell you a little story about a programmer named Joe. One time Joe tried to read and understand this code. (Bunch of stuff about how ugly the code was.) We don't hear much from Joe anymore. Last I heard, Joe was sorting mail at the post office."
  • by fireman sam ( 662213 ) on Wednesday February 09, 2005 @10:19PM (#11625986) Homepage Journal
    Most of the comments here are about what funny things are said in the source code. I think a more interesting piece from the article is "These issues include intellectual property rights". This to me states that either they have licenced parts of the Windows Forms code from third parties, or (for those of you with tin foil hats, put them on now) they have "borrowed" parts of the code from third parties and do not want them to find out about it. Hmmm.
  • by dbIII ( 701233 ) on Wednesday February 09, 2005 @10:19PM (#11625988)
    I think the most likely comments that they don't want anyone to see would be along the lines of "hardware product X is crap, but this driver at least gets the pitious fools that buy it to be able to use it."

    Comments like that read by the wrong people end up with expensive legal action - paticularly if the product really is crap.

  • by kbahey ( 102895 ) on Wednesday February 09, 2005 @10:30PM (#11626089) Homepage

    Two projects I worked on had to deal with 'inappropriate comments':

    The first was when a reference to Black Sabbath (a music band) was in some comments. Normally, source is not given to customers, but in this case, it was a shell script, so it did go to customers.

    Those who asked for that change were from the useability group. The guy who had to fix it was the archtypical anti-social nerd, but had a strange sense of humor. He entered an issue in the bug/change tracking system saying something like 'change Black Sabbath comment as per customer request'. The irony is, source had the CVS $Log$ tag, which caused all the fix comments of CVS to be in the source [no matter that I thought it was a bad idea, and that 'cvs log ....' would get you the same info, a manager said "this is the standard here"], so the issue description got into the log comments, and Black Sabbath was there again! Ha!

    In another case, we had a product that relied on an open source but commerical product. That product was developed by nerds who used programmers' humor all over the help pages, ...etc. The customer was upset by the use of 'conversational English' in the documentation. We had to get someone from the technical writing team to rewrite those pages! Nevermind that the product was geared towards sysadmins and techies! Sigh.

  • A long time ago (Score:4, Interesting)

    by mingot ( 665080 ) on Wednesday February 09, 2005 @11:10PM (#11626398)
    I was on the way to a job interview and remembered that they had requested a code sample. I remembered the nifty job I'd done on a DDE interface to netscape (it was small, clean code, and took quite a bit of research and teeth gnashing to get right). I located the source file, printed and printed it out.

    During the interview the hiring manager started going over the code with me and having me explain what it did, how it did it, etc. And then he got down to the /* This is fucking bizzare, blah blah */.

    I felt pretty sunk. Ended up getting the job, though.
  • True hell (Score:5, Funny)

    by hkb ( 777908 ) on Wednesday February 09, 2005 @11:59PM (#11626769)
    You know no hell until you use the goatse site as a test url in development and forget to take it out when the code goes live, and a user and then your boss find out before you do.
  • by pleumann ( 219030 ) on Thursday February 10, 2005 @05:10AM (#11628008)
    /**
    * The following lines are required to break
    * DR-DOS compatibility. Don't remove!
    */
    and
    /**
    * Make sure our own application loads
    * quicker than all the competitors.
    */
    and
    /**
    * Keep this security leak. Sell antivirus
    * software later.
    */
  • by HogynCymraeg ( 624823 ) on Thursday February 10, 2005 @06:52AM (#11628320)
    if(version=="95") delay = 100000;
    if(version=="98") delay = 90000;
    if(version=="ME") delay = 90000;
    if(version=="2000") delay = 80000;
    if(version=="XP") delay = 70000;
    if(version=="LONGHORN") delay = 60000; // more like forever *lol*

    sleep(delay);
  • by mwood ( 25379 ) on Thursday February 10, 2005 @09:58AM (#11629806)
    "I wonder what kind of things developers put in comments that would be so bad for the rest of us to see?"

    If you had done more coding, you would know. :-)

    "Stupid pointless [expletive deleted] for Marketing" or "This is dumb but the boss says Do It".

    "I have no idea why this works, so don't touch it!"

    "Kill 'em all, let God sort 'em out!!!" (on an instruction to skip over whitespace).

    And some actual examples I'd be embarrassed to repeat.

    I guess that when one spends all day writing bloodless prose for an unfeeling machine, commentary seems like the only emotional outlet one has. I've written a few comments which were, ah, amazingly vivid considering the humble nature of the operations they describe.

The world will end in 5 minutes. Please log out.

Working...