Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Nothing wrong with using goto, sparingly. It's the preferred way for error handling in C.

Nobody has code like this anymore

    10 I=1
    20 PRINT "HELLO "
    40 PRINT %I
    50 IF (%I > 3) 10 40
    30 PRINTLN "WORLD"
    45 PRINTLN
    42 I=%I+1
Notice no goto statement, yet lots of implicit gotos.


What about a Goto within a switch statement that's within another switch statement in a function that's 3000 lines long?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: