Search for a label than a trailing right brace

  • Thread starter Thread starter rcgldr
  • Start date Start date
  • Tags Tags
    Search
Click For Summary

Discussion Overview

The discussion revolves around the use of "goto" statements in programming, particularly in C, and the implications for code readability and structure. Participants explore the merits and drawbacks of using "goto" versus structured programming constructs like loops and conditionals, as well as the impact on code clarity and maintainability.

Discussion Character

  • Debate/contested
  • Technical explanation
  • Conceptual clarification

Main Points Raised

  • Some participants argue that "goto" statements can simplify code structure by allowing multiple entry and exit points, especially in complex loops.
  • Others contend that "goto" leads to unstructured code that is harder to read and maintain, advocating for the use of loops and conditionals instead.
  • A participant suggests that with proper indentation and brace notation, C-style code can be just as clear as code using "goto".
  • There is a claim that any algorithm can be expressed using a single while loop and if-then-else structures, referencing the Boehm and Jacopini theorem.
  • Some participants express a preference for using function pointers over "goto" for deferred actions, citing improved organization and readability.
  • Disagreement exists regarding the dependency of steps in sequential processes, with some arguing that indentation reflects logical dependencies while others assert that it can misrepresent the structure of the code.

Areas of Agreement / Disagreement

Participants do not reach a consensus on the use of "goto" statements. Multiple competing views remain regarding their appropriateness and impact on code readability.

Contextual Notes

Participants reference the Boehm and Jacopini theorem to support their claims about algorithm structure, but the applicability of this theorem to practical programming scenarios remains a point of contention.

  • #91


D H said:
That an N statement perniciously written pile of spaghetti might expand to N! statements of neatly written structured program should not be too surprising. This rewriting of the code is essentially the general Boolean satisfiability problem, which is of course an NP-complete problem.

You are not making any sense to me. How about you make things a bit more formal?
 

Similar threads

  • · Replies 3 ·
Replies
3
Views
2K
Replies
81
Views
7K
  • · Replies 26 ·
Replies
26
Views
5K
Replies
5
Views
8K
Replies
19
Views
2K
  • · Replies 75 ·
3
Replies
75
Views
6K
  • Sticky
  • · Replies 13 ·
Replies
13
Views
8K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 16 ·
Replies
16
Views
5K