Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

while vs for loops? #73

Open
brownsarahm opened this issue Jun 15, 2018 · 2 comments
Open

while vs for loops? #73

brownsarahm opened this issue Jun 15, 2018 · 2 comments

Comments

@brownsarahm
Copy link
Contributor

Is there a reason to introduce while loops beofore for loops? There is also more content on while loops than for loops. I think for loops are more common; while loops may not even be necessary.

@diniangela
Copy link

With while loops, you can see each of the initialization, stopping condition, and iterative step separately in 3 different lines. Because of this, you can explain the concept of loops more easily in a way that your users can grasp. Then, after the students understand the concept of a while loop, you can introduce the for loop and show that it is a more concise way of doing a while loop.

@eldobbins
Copy link

But so many errors are possible with while loops. I think for loops have training wheels and while loops are more flexible. I agree that for loops should go first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants