3 ms·
goto does not have intention so the reader of code has no idea what is it for (and its uses are not limited by loops, branching or switches).
by techno_modus 10y ago
goto does not have intention so the reader of code has no idea what is it for (and its uses are not limited by loops, branching or switches).
- gpderetta 10y agobut goto does point to a label. By giving it a meaningful name you can convey more information than with other flow control statements (except for function calls). On the other hand, I think I only used goto once in production in my career (to get out of a double nested loop). And it had a bug.
- techno_modus 10y agoAs usual, missing semantics/intention can be encoded in labels using some kind of naming conventions (or in comments). It is however also a dangerous approach because naming conventions are not controlled and not enforced by the language.
- gpderetta 10y agoAnd that's why we call all our functions fn_### and only rely on types to convey information. /s