Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Speed is all in the design

Name: Anonymous 2007-07-19 1:55 ID:NhlisZ3h

If you write a program in C# or Java and it's slow, you have nobody but yourself to blame.  Learn how to structure your program better, noob.

Name: enterprise programmer 2007-07-19 5:45 ID:UFZYlrh/

// For code you can never be sure enough about whether it'll work the first 999 times...

public void doIt()
{
    doIt(0);
}

private void doIt(int numFailTries)
{
    try {

        doItSupport();

    } catch (Exception e) {
        numFailTries++;
        System.out.println("Failed " + numFailTries + " times);
        if(numFailTries < 1000) {

            doIt(numFailTries); //Again

        } else {
            // arbitrary upper limit of 1000 failures,
            // if it fails this many times,
            // something is probably REALLY fucked

            // notify user
            System.out.println("Something is probably REALLY fucked... giving up");
        }
    }
}

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List