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

20 of 526 comments (clear)

  1. 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.
  2. 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 PeanutGallery · · Score: 2, Interesting

      Yeah, back a couple of years ago when I was writing firmware for [Company name baleeted] we wrote a simple Winderz client driver to test our stuff against while the driver guys got the "official" driver working. Of course ours was peppered with bizarre comments (and worse, sceen messages).

      I still remember the day the MSCE's wandered in and confiscated our driver because they couldn't seem to make theirs work quite right. To this day I wonder how many calls tech support has gotten asking what the "She's gonna blow capn'!" dialog is all about.

      Lesson to all Noob's (and anyone else who hasn't had the pleasure): NEVER WRITE ANYTHING YOU WOULDN'T WANT YOUR GRANDMA TO READ! (Cuz you just never know where it'll turn up)

      --
      -- Just another unsolicited opinion... from the Peanut Gallery.
  3. 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
  4. 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.
  5. Re:Innapropriate comments? What the. by cnettel · · Score: 2, Interesting
    I really disagree here. Clever code may be one thing, but readable code should need very few comments except for the few really tricky parts. A few lines above each function desribing them (perharps Javadoc style) is good, but if you need to explain what you're doing for every line, your code is bad. Keeping comments describing what your bad code does to make it readable is a worse option than readable code -- twice the amount of data and you need to keep them synchronized. (What if the bad code really doesn't do what the good comment tells you that it does? A clear no-no.)

    A comment containing some profanity may not be the best way to do it, but I can understand the sentiment. A comment could be in place exactly to alleviate a "WTF" sensation for the prospective reader, it could seem that something strange is going on in the code, and we've written a description for why it is that way, maybe even after having debugged it ourselves.

    Good code with good variable naming in a good language needs little commenting. As I said, method header comments is another cup of tea, because those may more center around design decisions and the bigger picture, which might be harder to get just by reading the individual pieces of code, no matter how well-commented each piece is.

  6. Let me tell you a lilttle story about Joe by Saint+Stephen · · Score: 2, Interesting

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

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

  8. Most likely: /* card is crap - workaround */ by dbIII · · Score: 2, Interesting
    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.

  9. Microsoft... by Beatlebum · · Score: 2, Interesting

    I bet there are code comments inside CreateWindow saying feature X was added to assist Word/Excel/Powerpoint.

  10. A long time ago by mingot · · Score: 3, Interesting

    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.

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

  12. Re:I wonder... by Brandybuck · · Score: 2, Interesting

    Seen in real life: /* IMPORTANT: comment out the following before release */

    This was above a section of code that gave the developer a gaping back door into the system for debug purposes. The code in question had been out in the field for over five years.

    --
    Don't blame me, I didn't vote for either of them!
  13. Re:ever hear of grep? by BasilBrush · · Score: 3, Interesting
    Not really true if the point of the source being there is to step through the API when debugging, as it is here. Your're not debugging or maintaining the commentless code. So long as there is documentation on what the call is supposed to do, and the identifiers used in the code are at least somewhat reasonable, that's plenty.

    I used to work for an company that produced a commercial OS, and their policy was to discourage comments. Their goal was to make readable code, and when you are tempted to make a comment, that means the code was getting too complex and needed simplifying, or better choices of identifiers. Comments were a last resort, shunned as they tend to go out of date faster than the code. Unfortunately the ideal had only limited success, as writing legible code is a skill most coders don't possess. When the idea worked, it worked well. When it failed, you had unreadable code without comments.

  14. 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.
  15. The best I saw was in Jaguar Doom source by The+Tyrant · · Score: 2, Interesting

    The port of Doom for the Atari Jaguar was done largely by an automated tool which turned the C code into risc assembly, thus removing all meaningful lables, variable names, and comments from the source. It was then patched to get round the bugs in the processors, and thus contains no comments at all except for one, which apears often, of "FUCKING DSP!!!"

    No, really.

  16. Re:Best of the 'inappropiate comments' by mpe · · Score: 3, Interesting

    I prefer to think the most inappropriate comment possible would be: GNU General Public License, version 2.0

    As well as any other comment which implies piracy. If the developers are working on code they never expect to be seen by "outsiders" they are unlikly to be concerned about "borrowing" someone else's code.

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

    Actually pulling in any GPL'd code is a good way to get yourself fired at Microsoft. They are pretty careful about that sort of thing.

    Now BSD licensed code, on the other hand, is all over the place in their projects.

  18. Re:Best of the 'inappropiate comments' by gilesjuk · · Score: 2, Interesting

    Well the article does mention IP issues. So it shows that closed source code can have licensing/patent issues also.

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