Slashdot Mirror


Linux Kernel Code Humor

An anonymous reader writes "This article points to some pretty funny comments and code in the Linux kernel. From colorful metaphors, to burning printers, to happy meals... A recursive search through the entire code base reveals some interesting language. Is all code like this?"

12 of 485 comments (clear)

  1. Re:Well no, it's not all like that by fizban · · Score: 3, Insightful

    I actually think there's probably plenty of "Fuck Clippy" messages in Microsoft code, and they won't release it because it would show how much they hate themselves.

    The developers in Microsoft can be quite at odds at the organization itself, like in any company...

    --

    +1 Insightful, -1 Troll. What can I say, I'm an Insightful Troll.

  2. Re:Is all code like this? by Hayzeus · · Score: 3, Insightful
    Provided the language is inoffensive, this is simply not the case with most outfits.

    No comments at all are (rightly) far more likely to get you fired.

  3. Re:at my last job by Anonymous Coward · · Score: 1, Insightful
    how else to keep it interesting?

    Don't use comments at all. Then, use lots of pointers and pointer math. Instead of just plain old:

    int i = 7;


    Try

    int* i;
    i = (int)malloc(sizeof(int));
    *i = (int)7;


    I'm sure you can manage lots of other great examples.
  4. Re:Linus by QuMa · · Score: 2, Insightful
    • C99 Allows // style comments
    • The linux kernel isn't written to be cross-compiler, it's written to work with GCC. And any other compilers it works with are either modifications of GCC or have put a lot of work into acting like GCC.
  5. Re:Is all code like this? by Anonymous Coward · · Score: 1, Insightful
    Haven't had to actually work with "other people" in a code-reviewed environment, have you? Get out of your parent's basement, real people write real code and don't need to resort to profanity for it.

    Some of us have jobs that involve writing well documented code in a workgroup, towards a specific goal. Not trying spending the day playing with the gimp writing kewl themez for xmms.

  6. Re:Funny comments from other systems by Anders · · Score: 3, Insightful

    Of course the most famous of all is the comment in the task switching code of the original v6 Unix (Lyons commentary era) which said ... /* You are not expected to understand this */

    And, of course, it means something like "this won't be on the exam". See Odd Comments and Strange Doings in Unix for more of this kind of fun.

  7. Re:The purpose of comments is to be USEFUL... by gilroy · · Score: 3, Insightful
    No. A purpose of comments is to be useful. As the bazillion examples posted here show, there are apparently other uses for comments, such as to let off steam, amuse oneself (or one's peers), or just be clever.


    Unless the spurious commenting actively obstructs maintenance -- and it's hard to imagine how it could do that -- it's perfectly fine if it's funny, witty, or (gasp!) off-task. Work is done better by those who enjoy themselves doing it.

  8. Re:after I was laid off ... by Sayjack · · Score: 3, Insightful

    Companies which lay people off, then let them code for the remaining 2 weeks are pretty naive. The last thing you want in your system is a pissed off coder.

    I'd rather have a hacker in my system than an angry coder any day. They should get a clue.

    --

    -- Good judgement comes with experience. -- Experience comes with bad judgement.

  9. Re:Sometimes, and it can cause problems too. by coyote-san · · Score: 4, Insightful

    The saddest thing is that the managers will never understand that they're responsible for their own problems. There are a lot of valid reasons for easing somebody out of the door, but the style of comments acceptable at the company before the merger is not one of them.

    N.B., I am not defending comments that are abusive to coworkers, slanderous, etc. That type of language has no place in an office.

    But the tone of a comment is a valuable indication of how much effort was put into fixing it. If I see a comment like // workaround, some_library_call() isn't working like advertised

    it tells me that they RTFM but found a workaround. Maybe a future version of the library (or the FM) will get it right. I probably don't need to talk to the author before touching the code myself. In contrast, a comment like // fucking windows refuses to allow us to keep both widgets visible at the same time, so we'll do this instead...

    tells me that they put a lot of effort into finding a solution to the problem, but every attempt failed. If I have an idea, I should talk to the author to see if he's already tried it. (Better yet would be a pointer to some internal document detailing everything they tried.)

    This isn't absolute - many people will never let their comments contain any emotional tone, and others will swear at the slightest problem. But it's a valuable tool when it's used properly.

    (Speaking of bugs, why does slashcode insist on merging paragraphs?)

    --
    For every complex problem there is an answer that is clear, simple, and wrong. -- H L Mencken
  10. Re:Is all code like this? by jaavaaguru · · Score: 3, Insightful

    The differnece between "12 hours working on it" and "12 hours fsking with it" shows how difficult the problem was to solve, and as far as I'm concerned could be useful to someone else looking at the code later. Leaving it in is only an option with code that stays in-house I guess.

  11. Re:Dutch code! by ntp · · Score: 3, Insightful

    Not pointless. It's saved in a static variable so glGetString and strcmp are only called once, even if the function is called a million times.

    --
    I control the time!
  12. Re:Is all code like this? by GlassHeart · · Score: 3, Insightful
    Is it just me, or do the words "professional" and/or "mature," when they occur next to "programmer," actually mean "conservative," or "humorless," or "full of him/herself?"

    Humor can co-exist with professionalism. However, source code is not where you put it. If you ever release that code to a customer, it could damage your company's reputation. Too many such comments could interfere with efforts to search the source code. Humor also often language- and culture-dependent, so your company's foreign employees may even misunderstand subtle jokes as actual useful comments about the code. And then it's no longer funny.

    Not to say that many such coding standards are little more than power trips. However, a professional will always keep in mind the fact that the source code doesn't belong to him or her. If you don't like the rules set by your employer, find another job.