Not important, only a curiosity...

This is a discussion on Not important, only a curiosity... within the C Programming forums, part of the General Programming Boards category; I just came back from Christmas "holidays"...and found my square RED?! Wow: I just understood how votation works.. And also ...

  1. #31
    Registered User
    Join Date
    Oct 2003
    Posts
    106
    I just came back from Christmas "holidays"...and found my square RED?! Wow: I just understood how votation works..

    And also I finally undestood the goto problem:
    - never SAY this word with programmers: they could think you're a chicken well dressed..
    - never WRITE this word in any piece code... don't #define it in another way, coward!
    - never THINK this word: it may take your reasoning into unpredictable states..!

    At this time...I don't remember what we're speaking about!! This should be good enough to bring my points up and restore the green square...

    Bye!

  2. #32
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,796
    >And also I finally undestood the goto problem:
    There is no goto problem. Use it when it's the best option, otherwise don't.

    >- never SAY this word with programmers:
    This only applies to ignorant programmers.

    >- never WRITE this word in any piece code...
    This only applies if you're posting code to a forum or newsgroup. For real programs the conventional motto is: Your code, your rules, and everyone else can butt out.

    >- never THINK this word:
    Don't listen to people like that, it's bad for your mental health.
    My best code is written with the delete key.

  3. #33
    Super Moderator
    Join Date
    Sep 2001
    Posts
    4,913
    In fact I found a use for it this morning. I was in a heavily nested loop and just used to break out of it when a certain condition could not be fulfilled.

  4. #34
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,796
    Why were you in a heavily nested loop to begin with? This is one of the valid uses for goto, but it's also one of the easier ones to replace through a function call. People who read your code will thank you for it too. The more layers of nesting a reader has to go through, the less they'll understand the logic.
    My best code is written with the delete key.

  5. #35
    Gawking at stupidity
    Join Date
    Jul 2004
    Location
    Oregon, USA
    Posts
    3,171
    The good folks that developed glibc even used it

    Found this when playing with that strstr() post last week:
    http://gehenna.pell.portland.or.us/~...strstr.c.glibc
    If you understand what you're doing, you're not learning anything.

  6. #36
    Super Moderator
    Join Date
    Sep 2001
    Posts
    4,913
    Why were you in a heavily nested loop to begin with?
    Parsing HTTP Headers. I've gotta keep reading in chars, to keep reading in header values, to keep reading in headers, until I reach a blank line signifying the beginning of HTTP content. And there are certain characters I can encounter which mean that the HTTP request is invalid - so I need to break out of the loop.

Page 3 of 3 FirstFirst 123
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Curiosity question...
    By Raigne in forum C++ Programming
    Replies: 2
    Last Post: 04-05-2007, 10:49 PM
  2. For me is very important Please...
    By pitkini in forum C++ Programming
    Replies: 3
    Last Post: 07-26-2005, 03:49 AM
  3. What Is Important In Making Games?
    By Krak in forum C++ Programming
    Replies: 6
    Last Post: 05-07-2004, 09:12 PM
  4. Planned Development Community Idea (important)
    By cozman in forum A Brief History of Cprogramming.com
    Replies: 2
    Last Post: 06-12-2002, 01:13 PM
  5. Most important element of a game?
    By Eber Kain in forum Game Programming
    Replies: 24
    Last Post: 01-11-2002, 03:04 PM

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