Slashdot Mirror


Why MS is Not Opening More Source Code

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?"

43 of 526 comments (clear)

  1. comments? by Anonymous Coward · · Score: 5, Funny

    /* Nothing for you to see here. Please move along. */

  2. Best of the 'inappropiate comments' by rednip · · Score: 5, Funny
    • 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!)...
    --
    The force that blew the Big Bang continues to accelerate.
    1. Re:Best of the 'inappropiate comments' by Anonymous Coward · · Score: 5, Funny

      I prefer to think the most inappropriate comment possible would be:

      GNU General Public License, version 2.0

    2. Re:Best of the 'inappropiate comments' by Anonymous Coward · · Score: 5, Funny

      Cmon. UNIX comments are way funnier.

      My personal favorite:

      /* You are not expected to understand this. */

    3. Re:Best of the 'inappropiate comments' by Zocalo · · Score: 5, Informative

      Well that's a little out of context, but there is a short page about "odd" comments in UNIX which includes an explaination of the abovehere.

      --
      UNIX? They're not even circumcised! Savages!
    4. Re:Best of the 'inappropiate comments' by mungtor · · Score: 5, Funny

      Probably much more like: /* well, Bill is still a douchebag, so here goes the "extended" standard crap */

      or /* Instead of doing this right, we'll just keep doing it our way */

      and don't forget /* let's see those Open Source assholes figure this one out */

    5. Re:Best of the 'inappropiate comments' by GordoSlasher · · Score: 4, Funny
      I found my favorite Unix comment while browsing through the Unix sixth edition source (yes this was a loooong time ago). Embedded within reams of commentless code was:

      /* this is a comment */

    6. Re:Best of the 'inappropiate comments' by Brandybuck · · Score: 5, Funny

      I see that one all the time in the proprietary code base at work.

      --
      Don't blame me, I didn't vote for either of them!
    7. Re:Best of the 'inappropiate comments' by Aeiri · · Score: 5, Interesting

      My favorites are the ones from the "drivers/net/sunhme.c" file of the Linux Kernel:

      /* Welcome to Sun Microsystems, can I take your order please? */ ... /* Would you like fries with that? */ ... /* Anything else? */ ... /* Fifty-two cents is your change, have a nice day. */

      /* We have a special on GNU/Viking hardware bugs today. */ ... /* Will that be all? */ ... /* Don't forget your vik_1137125_wa. Have a nice day. */

      /* foo on you */

      /* Lettuce, tomato, buggy hardware (no extra charge)? */

      /* We're consolidating our STB products, it's your lucky day. */ ... /* Come back next week when we are "Sun Microelectronics". */ ... /* Remember: "Different name, same old buggy as shit hardware." */

      /* Only Sun can take such nice parts and fuck up the programming interface
      * like this. Good job guys...
      */

    8. Re:Best of the 'inappropiate comments' by igb · · Score: 5, Informative

      For those missing the joke, the hme ethernet
      interface gets its name from the `Happy Meal'
      ethernet/SCSI combo card, so named because
      you get both interfaces as a discount deal.
      The same chipset went onboard some machines, too.
      The PCI version (Happy Meal was SBus) I think
      was named Fresh Choice (two trips to the ASIC
      salad bar) after the valley eateries, but I
      might be misremembering.

      ian

    9. Re:Best of the 'inappropiate comments' by jzap · · Score: 4, Funny

      Or the Rene Magritte variant:
      /* This is not a comment. */

    10. Re:Best of the 'inappropiate comments' by MadMoses · · Score: 4, Funny

      Best comment I ever saw was an unused char array in some C code, initialised with all '0's, and the comment //here we insert some zeros to keep the code fluffy and airy

      --

      Do not be alarmed. This is only a test.
  3. grep by mmkkbb · · Score: 5, Funny

    /* The word 'fuck' is here so you can grep for it */

    --
    -mkb
  4. ha by momerath2003 · · Score: 5, Interesting

    Heh, no surprises here. I mean, from what we've seen from the leaked windows source...

    --
    I had but a simple dream, to destroy all humans.
    1. Re:ha by RonnyJ · · Score: 4, Informative

      Actually, the first link there isn't from Windows source code, it's from the source of a Linux USB camera driver (as you can see when you look at the parent post to it).

  5. "Linux Rocks!!!" by jdray · · Score: 4, Funny
    10 REM Linux rocks!!!
    20 Do(stuff);
    --
    The Spoon
    Updated 6/28/2011
  6. I wonder... by PornMaster · · Score: 4, Funny

    // horribly insecure, but we had to meet a ship date...

  7. Programmers do to comment. by kngthdn · · Score: 5, Funny
    ...

    /* 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);

    ...

  8. Well... for starters... by Duncan3 · · Score: 5, Funny

    /* Copyright © 2000 Apple Computer, Inc. All rights reserved. */

    --
    - Adam L. Beberg - The Cosm Project - http://www.mithral.com/
    1. Re:Well... for starters... by NanoGator · · Score: 4, Insightful

      "/* Copyright © 2000 Apple Computer, Inc. All rights reserved. */" /* Special thanks to Xerox */

      --
      "Derp de derp."
  9. Hard habit to break. by shotgunefx · · Score: 5, Interesting

    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 :)

    --

    -William Shatner can be neither created nor destroyed.
    1. Re:Hard habit to break. by jbarket · · Score: 4, Funny

      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

      --

      -----
      jonathan barket
    2. Re:Hard habit to break. by slashrogue · · Score: 4, Funny

      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 ;)

    3. Re:Hard habit to break. by noidentity · · Score: 4, Funny

      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.

  10. How about this? by mtrisk · · Score: 4, Funny

    /* 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.

    --

    Without a proper flamewar, Anonymous was undecided on what shell to run.
    1. Re:How about this? by ScrewMaster · · Score: 4, Interesting

      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.

      --
      The higher the technology, the sharper that two-edged sword.
    2. Re:How about this? by lakeland · · Score: 5, Interesting

      Yeah yeah, YHBT and all that...

      Notice how the code snippet you pasted is inside #if? That means the preprocessor will strip it out at compile time, not run time... got that? Next you note that htons performs the same check. That would be the htons function right? There's this thing about functions... Every time you call them you have to push your state onto the stack, wasting cycles. That means your version will waste a processor cycles every single time it is called, but the linux one won't. We call this optimisation.

      What's that? Cycles don't matter? How frequently do you think the function above is called? Can you be certain it won't be called when performance is key? Lets be clear, there is some ugly code in the linux kernel, most of it is stuff written years ago that could be refactored if anybody bothered. But pointing to an optimisation and saying: look, that's redundant! is just foolish.

  11. graph of fucks per line in the kernel by tepples · · Score: 5, Funny

    Better yet: The word 'fuck' is here so you can graph for it.

  12. Some suggestions... by mikael · · Score: 4, Funny

    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

    --
    Vintage computer adverts: http://www.vintageadbrowser.com/computers-and-software-ads
  13. sometimes its things that get mis-interpreted by willCode4Beer.com · · Score: 4, Interesting

    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.

    --
    ----- If communism is a system where the government owns business, what do you call a system where business owns govern
  14. Easy... by Epsillon · · Score: 5, Funny

    /* 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 */

    ;-)

    --
    Resistance is futile. Reactance buggers it up.
  15. Examples of Comments MS Don't Want You to See by Nova+Express · · Score: 5, Funny
    ///**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!**///

    --
    Lawrence Person (lawrencepersonh@gmailh.com (remove all "h"s to mail)

    http://www.lawrenceperson.com/

  16. Re:Inappropriate comments.... by Anonymous Coward · · Score: 5, Funny

    Well, if ya look at the performance, it's pretty obviously not C.

  17. Quake III by Neo_Ludite · · Score: 5, Funny

    My favorite from the Quake III source
    i = 0x5f3759df - ( i >> 1 ); // what the fuck?

    1. Re:Quake III by Vengie · · Score: 5, Informative

      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

      --
      When in doubt, parenthesize. At the very least it will let some poor schmuck bounce on the % key in vi. (Larry Wall)
  18. Best comment I ever saw by Gildenstern · · Score: 5, Funny
    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*/

  19. Two examples by kbahey · · Score: 4, Funny

    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.

  20. True hell by hkb · · Score: 4, Funny

    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.

    --
    /* Moderating all non-anonymous trolls up since 2004 */
  21. More Sun-related Linux kernel gems by DragonHawk · · Score: 5, Interesting

    These all from 2.6:

    arch/sparc/kernel/ptrace.c:/* Fuck me gently with a chainsaw... */

    arch/sparc/kernel/head.S: /* XXX Fucking Cypress... */

    arch/sparc/kernel/sunos_ioctl.c: /* Binary compatibility is good American knowhow fuckin' up. */

    arch/sparc64/mm/init.c: /* Fucking losing PROM has more mappings in the TLB, but

    arch/sparc64/kernel/traps.c: /* Why the fuck did they have to change this? */

    Even better is this from 2.4:

    arch/sparc/mm/srmmu.c: Are you now convinced that the Swift is one of the
    biggest VLSI abortions of all time? Bravo Fujitsu!
    Fujitsu, the !#?!%$'d up processor people. I bet if
    you examined the microcode of the Swift you'd find
    XXX's all over the place.

    --

    dragonhawk@iname.microsoft.com
    I do not like Microsoft. Remove them from my email address.
  22. Actually, I doubt it by Moraelin · · Score: 4, Insightful

    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.)

    --
    A polar bear is a cartesian bear after a coordinate transform.
    1. Re:Actually, I doubt it by Moraelin · · Score: 4, Insightful

      If that's what you think, you might be in for a _very_ nasty surprise at some point.

      That nobody at the workplace cares about you in a good way, that's probably not a bad frame of mind. Cynical, that's true, but most of the time it's accurate.

      But you might be surprised who cares about you in a _bad_ way. Who's out on a personal quest to prove to the boss that your code is utter crap and you should be fired. Or at least he should be promoted before you.

      I've already posted one such true story on Slashdot (I fondly called it "Jack and Jill up corporate hill), where a marketeer-turned-programmer I know (and to my shame, which I've helped get into programming) made it a personal quest to get both female programmers on his floor fired. He succeeded too.

      He'd run with snippets of those programmers code to every single guy in the building, to show everyone what bad code they wrote. Invariably he was wrong, and just showed _massive_ incompetence, and their code was good. He didn't even know the most elementary _basics_ of Java, the language he's paid to program in. But obviously it wasn't obvious to the boss, seein' as he did get them both fired, and he got promoted.

      A more sad case was someone who couldn't program at all. No, not just "not a top programmer." He just couldn't write code that even compiled. At all.

      So a couple of co-workers took pity and started helping him. Well, not as much "helping", as outright writing his modules for him.

      So what does he do? Make it his personal quest to bad-mouth them to the boss behind their backs, and "prove" that they just interfere with his work and he surely would have done better if they hadn't edited his files. (Never mind that he had actually asked for their help to start with.)

      There's one important lesson in corporate cynicism there, grasshopper. The person you helped might be not a friend, and not even indifferent: you might have actually made an _enemy_. You're one of those who know he's incompetent, and that makes you dangerous. Worse yet, you might be seen as a good programmer, and as such in his mind (and usually _only_ in his mind) someone who might get promoted before him. You're an obstacle to be taken out of the way.

      How's that for being even more cynical? :P

      --
      A polar bear is a cartesian bear after a coordinate transform.
  23. Evil stuff we always suspected... by pleumann · · Score: 4, Funny
    /**
    * 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.
    */
  24. What comments are those? by mwood · · Score: 4, Interesting

    "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.