Lets hear what the old fathers told us...
when Linus Torvalds was still running around the Christmas tree....



Niklaus Wirth,

Algorithms and Data Structures 1985 (Oberon version: August 2004, afaik first published 1975 in German)

(Regarding pointers and goto statements..)
...This phenomenon of power and flexibility being intimately coupled with the danger of misuse is well known in programming, and it particularly recalls the GOTO statement. Indeed, if the analogy between program structures and data structures is to be extended, the purely recursive data structure could well be placed at the level corresponding with the procedure, whereas the introduction of pointers is comparable to the use of GOTO statements. For, as the GOTO statement allows the construction of any kind of program pattern (including loops), so do pointers allow for the composition of any kind of data structure (including rings).


Kernighan , Ritchie, The C Programming Language 1978
page 62

C provides the infinitely-abusable goto statement, and labels to branch to. Formally the goto is never necessary and in practice it is almost always easy to write code without it. We have not used goto in this book. Nonetheless , we will suggest a few situations where goto's may find a place. The most common use is to abandon processing in some deeply nested structure, such as breaking out of two loops at once. The break statement cannot be used directly since it leaves only the innermost loop....
.....
Although we are not dogmatic about a matter, it does seem that goto statements should be used sparingly, if at all.


Mit freundlichen Grüßen

Markus Greim

_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to