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.

12
  • 1
    $\begingroup$ This is a very interesting answer. Welcome to Computer Science Educators! My only suggestion is that it might be helpful for you to draw a more direct connection between the question and the answer. $\endgroup$ Commented Jan 29, 2018 at 15:33
  • 1
    $\begingroup$ I really like this perspective, and I hadn't quite thought about it stated so simply and cleanly before. (I also don't generally teach absolute beginners, so I don't have a ton of experience having to clarify this particular idea.) This also puts a nice punctuation mark on Bryan R.'s observation, "I prefer to teach while loops as part of my unit on if/else statements since the syntax and thought process are virtually identical." $\endgroup$ Commented Jan 29, 2018 at 15:54
  • $\begingroup$ While I agree that this is how they are usually implemented. This is back to the structured/un-structured high/low level argument, that you were not here for. (yes I said usually: for example on the ARM — the most popular ≥ 32bit cpu on the planet at this time — conditional and iteration are implemented different at the very low level. For a backward conditional branch of a loop the branch predictor assumes that the branch will happen. For a forward conditional of an if it is assumed not to happen. Arm also has conditional instructions. ) But thanks for contributing. $\endgroup$ Commented Jan 29, 2018 at 16:09
  • 1
    $\begingroup$ "The only difference between an IF-Else and a Loop of any kind is whether you branch downward or back to the top" just isn't true. DO...WHILE and LOOP...UNTIL and FOR X UNTIL Y STEP Z are nothing but (very useful) syntactic sugar laid over TEST and BRANCH. $\endgroup$ Commented Jan 29, 2018 at 16:45
  • 3
    $\begingroup$ The importance of this answer is that it emphasizes underlying concepts. I think it can help, not only hurt, to teach this first - unstructured control in various forms, and then teach structured control. That presents an excellent opportunity to teach why structured control is preferable. IOW, more or less follow the history -- the history itself evolved the way it did for good reasons. It's not just about teaching the use of a particular language; it's about teaching what's going on - why we do things the way we do. The various iteration constructs did not fall from the sky. $\endgroup$ Commented Jan 30, 2018 at 15:31