Silly Jokes

This is a discussion on Silly Jokes within the A Brief History of Cprogramming.com forums, part of the Community Boards category; Hi everyone, I'm a huge fan of silly code snippets, made up and real ones. Here are some of my ...

  1. #1
    Complete Beginner
    Join Date
    Feb 2009
    Posts
    312

    Silly Jokes

    Hi everyone,

    I'm a huge fan of silly code snippets, made up and real ones. Here are some of my favorites:

    Code:
    int getRandomNumber()
    {
            return 4;    // carefully chosen by rolling a dice
    }

    Code:
    while(1)
            fork();

    Code:
    /* no comment */

    Code:
    #define moin main
    
    int moin(int argc, char *argv[]) {
            // ...
    }
    If your German is a bit rusty, the last one probably needs some explanation: "moin" is generally accepted as short for "Guten Morgen"/"Hallo", which means "Good Morning"/"Hello" in English.

    What else have you got?

    Greets,
    Philip
    All things begin as source code.
    Source code begins with an empty file.
    -- Tao Te Chip

  2. #2
    spurious conceit MK27's Avatar
    Join Date
    Jul 2008
    Location
    segmentation fault
    Posts
    8,300
    Trust people who name operating systems after horned beasts: How the way people code "Hello World" varies

    My fav's were the "seasoned hacker" and "guru hacker"...!

    Which is the same place I found "C+-: The first subject-oriented programming language". Hahaha...

    ps. the only people who say "Good Morning"/"Hello" in English now-a-days are the same schizoid meglomaniacs who say "See You Later"/"Good Bye"/(pause)/"Farewell" and then throw in some Italian and Portuguese just to be sure.
    C programming resources:
    GNU C Function and Macro Index -- glibc reference manual
    The C Book -- nice online learner guide
    Current ISO draft standard
    CCAN -- new CPAN like open source library repository
    3 (different) GNU debugger tutorials: #1 -- #2 -- #3
    cpwiki -- our wiki on sourceforge

  3. #3
    and the hat of copycat stevesmithx's Avatar
    Join Date
    Sep 2007
    Posts
    507
    Here are some very good math formulae
    Not everything that can be counted counts, and not everything that counts can be counted
    - Albert Einstein.


    No programming language is perfect. There is not even a single best language; there are only languages well suited or perhaps poorly suited for particular purposes.
    - Herbert Mayer

  4. #4
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,834
    Does this describe anyone near you?
    Code:
    struct freelancer {
      short  temper;
      long   lunch;
      double money;
      void  *work;
      char   unstable;
    };
    More here
    http://www.gnu.org/fun/jokes/declarations.html
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  5. #5
    verbose cat
    Join Date
    Jun 2003
    Posts
    209
    one that I used in a program a while back:
    Code:
    #define hello int
    #define world main
    /* some other defines... */
    hello world(hello World,hellO* WorlD he1L0) {...
    abachler: "A great programmer never stops optimizing a piece of code until it consists of nothing but preprocessor directives and comments "

  6. #6
    In my head happyclown's Avatar
    Join Date
    Dec 2008
    Location
    In my head
    Posts
    391
    Quote Originally Posted by jEssYcAt View Post
    one that I used in a program a while back:
    Code:
    #define hello int
    #define world main
    /* some other defines... */
    hello world(hello World,hellO* WorlD he1L0) {...
    I like it!, even I have no idea how that code can create that output!
    OS: Linux Mint 13(Maya) LTS 64 bit.

  7. #7
    Complete Beginner
    Join Date
    Feb 2009
    Posts
    312
    Code:
    /* some other defines... */
    Nice understatement!


    Here's some more silly stuff:

    Code:
    /* YOUR KUNG-FU IS OLD AND NOW YOU MUST DIE!! */
    exit(0);
    From a Makefile:

    Code:
    love:
            @echo not war.
    And the famous comment from Unix Sixth Edition source code:

    Code:
     /* You are not expected to understand this */
    More funny stuff can be found on Dennis Ritchie's homepage.


    And for some profound insight on the quality of Linux source code, try the following:

    Code:
    grep -R "[Ff]uck" /usr/src/linux/
    Greets,
    Philip
    All things begin as source code.
    Source code begins with an empty file.
    -- Tao Te Chip

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Silly Q about circular references
    By ppmoore in forum C Programming
    Replies: 8
    Last Post: 10-04-2006, 03:07 PM
  2. best download site
    By gooddevil in forum A Brief History of Cprogramming.com
    Replies: 2
    Last Post: 05-20-2004, 11:36 PM
  3. Sreen Resolution Statistics?
    By Davros in forum A Brief History of Cprogramming.com
    Replies: 38
    Last Post: 04-26-2004, 03:33 PM
  4. Post your jokes here!
    By fuh in forum A Brief History of Cprogramming.com
    Replies: 26
    Last Post: 01-14-2003, 07:45 PM
  5. Clean Jokes
    By stevey in forum A Brief History of Cprogramming.com
    Replies: 35
    Last Post: 04-27-2002, 08:13 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21