anyone here hate when foo bar baz is used in example code?

This is a discussion on anyone here hate when foo bar baz is used in example code? within the A Brief History of Cprogramming.com forums, part of the Community Boards category; Originally Posted by maxorator Would you prefer words "egg", "ham" and "apple"? Yes I would. Infact just about any word ...

  1. #16
    Registered User
    Join Date
    Aug 2005
    Posts
    44
    Quote Originally Posted by maxorator
    Would you prefer words "egg", "ham" and "apple"?
    Yes I would. Infact just about any word in the dictionary would work better than foo, bar and baz because most words have a meaning that will describe the purpose the word is being used to represent. The words egg, ham and apple are nouns, they describe a single item, like something that would be stored in a array. Words that are verbs should be used as fuction names. Descriptive names document your code. When creating names for code that will teach a programming concept, it should be all the more important to use descriptive/self documenting names, but people choose to use meaningless words that sound like klingon babble. There are rare occasions when you want to explain a programming concept without directly dealing with how that concept is implemented, and in those rare cases you would use non-descriptive words to isolate the code from how it would be applied. But as Mario F mentioned, the use of foo, bar, baz has been exagerated to the point where it is always used for every code example.

  2. #17
    Registered Luser risby's Avatar
    Join Date
    Jun 2006
    Posts
    72
    Quote Originally Posted by shintaro
    To me there is nothing worst when programmers use the words foo bar and baz in generic example code.
    I do not like foo, bar and baz
    I just can't cope with all that jazz

    I do not like them in my code
    I won't be going down that road

    They won't appear in my program
    Not even for green eggs and ham

    I hate to see them in your script
    It sucks and makes me really pipped

    I've never liked foo, bar and baz
    And don't know anyone who has
    Last edited by risby; 09-26-2006 at 10:03 AM. Reason: scansion
    ===
    Don't grumble about what you can't have;
    be grateful you don't get what you deserve.

  3. #18
    Registered User
    Join Date
    Sep 2004
    Posts
    123
    It's pretty much all been said, but this Wikipedia entry explains metasyntactic variables.

    Like any system of mnemonics, they can be very useful if used correctly or pig awful if abused / used incorrectly / overused.
    I think you can put a signature here.

  4. #19
    Ethernal Noob
    Join Date
    Nov 2001
    Posts
    1,901
    *hears the word meta and goes into shell shock*

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Values changing without reason?
    By subtled in forum C Programming
    Replies: 2
    Last Post: 04-19-2007, 11:20 AM
  2. Explain this C code in english
    By soadlink in forum C Programming
    Replies: 16
    Last Post: 08-31-2006, 01:48 AM
  3. beach bar (sims type game)
    By DrKillPatient in forum Game Programming
    Replies: 1
    Last Post: 03-06-2006, 01:32 PM
  4. Replies: 0
    Last Post: 02-21-2002, 06:05 PM
  5. Replies: 4
    Last Post: 01-16-2002, 12:04 AM

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