Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

6
  • 1
    Please see en.wikipedia.org/wiki/Structured_programming Commented Aug 10, 2018 at 19:34
  • 1
    @ruakh I'm not sure what to take away from your comment. It comes across as somewhat passive-aggressive, as if my answer opposes what's written on the wiki page. Please elaborate. Commented Aug 14, 2018 at 15:27
  • "Structured programming" is a term of art with a specific meaning, and the OP is objectively correct that version #2 conforms to the rules of structured programming while version #1 does not. From your answer, it seemed that you were not familiar with the term of art, and were interpreting the term literally. I'm not sure why my comment comes across as passive-aggressive; I meant it simply as informative. Commented Aug 14, 2018 at 16:25
  • @ruakh I disagree that version #2 conforms to the rules more in every aspect and explained that in my answer. Commented Aug 14, 2018 at 17:25
  • You say "I disagree" as if it were a subjective thing, but it's not. Returning from inside a loop is a categorical violation of the rules of structured programming. I'm sure that many structured-programming enthusiasts are fans of minimally-scoped variables, but if you reduce a variable's scope by departing from structured programming, then you have departed from structured programming, period, and reducing the variable's scope doesn't undo that. Commented Aug 14, 2018 at 18:27