Skip to content

Commit 2ffd477

Browse files
fix #65 - dead link, reference to book
1 parent fb25d7c commit 2ffd477

File tree

1 file changed

+3
-4
lines changed
  • docs/4-language-usage/4-control-structures/3-flow-control

1 file changed

+3
-4
lines changed

docs/4-language-usage/4-control-structures/3-flow-control/g-4310.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,11 @@
55

66
## Reason
77

8-
Code containing gotos is hard to format. Indentation should be used to show logical structure and gotos have an effect on logical structure. Trying to use indentation to show the logical structure of a goto, however, is difficult or impossible.
8+
>Code containing gotos is hard to format. Indentation should be used to show logical structure, and gotos have an effect on logical structure. Using indentation to show the logical structure of a goto and its target, however, is difficult or impossible. (...)
99
10-
Use of gotos is a matter of religion. In modern languages, you can easily replace nine out of ten gotos with equivalent structured constructs. In these simple cases, you should replace gotos out of habit. In the hard cases,
11-
you can break the code into smaller routines; use nested ifs; test and retest a status variable; or restructure a conditional. Eliminating the goto is harder in these cases, but it's good mental exercise.
10+
> Use of gotos is a matter of religion. My dogma is that in modern languages, you can easily replace nine out of ten gotos with equivalent sequential constructs. In these simple cases, you should replace gotos out of habit. In the hard cases, you can still exorcise the goto in nine out of ten cases: You can break the code into smaller routines, use tryfinally, use nested ifs, test and retest a status variable, or restructure a conditional. Eliminating the goto is harder in these cases, but it’s good mental exercise (...).
1211
13-
Excerpt of [Using gotos by Steven C. McConnell](http://logos.cs.uic.edu/476/notes/GoTo/GoToMcConnel.html).
12+
>-- McConnell, Steve C. (2004). _Code Complete. Second Edition_. Microsoft Press.
1413
1514
## Example (bad)
1615

0 commit comments

Comments
 (0)