• Revenant (12/22/2011)


    GOTO is not as evil as it is painted today. When Dijkstra wrote his paper - which not many today's programmers have read -, real programmers programmed in Assembler and GOTO was one of the flavors of the 'branch' instruction. The recommended error handling construct looked like this:

    * coming back from a Supervisor call; return code is in register 1

    * return codes were multiples of 4

    B *+4(1) *+4 is the address of the following instruction

    B success you get here if the return code was 0

    B error4 you get here if the return code was 4

    B error8 etc.

    Imagine debugging a program with several 'branch tables' like this. Some Supervisor calls might return over 20 different errors.

    On the other hand, some GOTOs were actually encouraged; e.g., BXLE or Branch on Index Lower or Equal, which was the best way to do a WHILE loop.

    Don't tell me your one of those that thinks assembler is real programing? I bet you don't from the way you write! Thou it's not entirely uncommon. Those goofs that likes to invent the wheel all over again and again..

    No I still stand by that GOTOs in 99% of all cases are written because the programmer did not know better and that was how he did it 20 years ago.