TI Conditionals & Spaghetti Code
|
05-18-2024, 11:46 PM
Post: #2
|
|||
|
|||
RE: TI Conditionals & Spaghetti Code
(05-18-2024 10:25 PM)Matt Agajanian Wrote: Hi all. Don't believe everything Dijkstra says. Virtually every CPU eventually translates comparison instructions and loops into jumps. GOTO, like any programming instruction, can be misused but it can also be used to make the logic of a program clearer. Keep your code organized into one way in, one way out and GOTO doesn't get in the way at all. Structured method: Code: DO Using GOTO: Code: LBL A Sure, these are trivial examples but they illustrate they GOTO doesn't need to create spaghetti code. The meaning of both segments is pretty clear. Tom L Cui bono? |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 5 Guest(s)