Results 1 to 4 of 4
  1. #1
    .::SCHiM::.'s Avatar
    Join Date
    Sep 2010
    Gender
    male
    Posts
    733
    Reputation
    180
    Thanks
    880
    My Mood
    Twisted

    Programing superstition

    Sometimes when I'm working on a project I do things like this:

    Code:
    while( true ){
    ...
    ...
        // just in case :D
    if( foo-- <= 0 ){
    
    }
    }
    Although it's impossible for integer 'foo' to just skip a value(ie. in a loop) I always check to see if it's equal to or less then <number here> even if it's impossible for foo to be anything lower then that number. I feel much safer when I do it like this.

    Sounds familiar? Or do you do something like this?
    Last edited by .::SCHiM::.; 12-18-2011 at 09:08 AM.

    I'm SCHiM

    Morals derive from the instinct to survive. Moral behavior is survival behavior above the individual level.

    Polymorphic engine
    Interprocess callback class
    SIN
    Infinite-precision arithmetic
    Hooking dynamic linkage
    (sloppy)Kernel mode Disassembler!!!

    Semi debugger




  2. #2
    Hell_Demon's Avatar
    Join Date
    Mar 2008
    Gender
    male
    Location
    I love causing havoc
    Posts
    3,976
    Reputation
    343
    Thanks
    4,320
    My Mood
    Cheeky
    ASSERT(foo-- <= 0);

    yay for debug builds :P
    Ah we-a blaze the fyah, make it bun dem!

  3. #3
    'Bruno's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Portugal
    Posts
    2,883
    Reputation
    290
    Thanks
    1,036
    My Mood
    Busy
    We never know.. we never know.. Yep same crap happens to me aswell.
    Light travels faster than sound. That's why most people seem bright until you hear them speak.

  4. #4
    .::SCHiM::.'s Avatar
    Join Date
    Sep 2010
    Gender
    male
    Posts
    733
    Reputation
    180
    Thanks
    880
    My Mood
    Twisted
    Perhaps we should start the first religion for programmers we all know that foo can't skip a step in a loop and yet there is something...

    I'm SCHiM

    Morals derive from the instinct to survive. Moral behavior is survival behavior above the individual level.

    Polymorphic engine
    Interprocess callback class
    SIN
    Infinite-precision arithmetic
    Hooking dynamic linkage
    (sloppy)Kernel mode Disassembler!!!

    Semi debugger




Similar Threads

  1. a good java program
    By snipelock in forum Java
    Replies: 18
    Last Post: 04-17-2009, 02:56 PM
  2. Runescape 2 auto programs
    By fabled in forum Hack Requests
    Replies: 19
    Last Post: 09-05-2007, 01:43 PM
  3. [Tutorial] Your first program
    By akimoko in forum C++/C Programming
    Replies: 10
    Last Post: 06-23-2007, 12:58 PM
  4. brainfuck Programming
    By sockopen in forum Programming
    Replies: 18
    Last Post: 07-05-2006, 05:15 AM
  5. Problem Wit Hacking Programs
    By f5awp in forum General Gaming
    Replies: 5
    Last Post: 01-10-2006, 05:44 AM