You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now, we do not ask students to do anything with loops because they interact poorly with the fact that our editor evaluates the program as soon as the code parses. This is problematic, because you could be in the middle of writing out something like:
for()
which will run forever, promptly locking up the UI.
@dhmquan and I briefly discussed a repeat construct that would not have this same issue. E.g.,
repeat(5) {
// whatever
}
One downside is that this construct does not provide a lexically-scoped loop variable like for. However, I think that this is OK. First, this is a learning tool, not a production language. Second, one can easily introduce a loop variable with:
i = 0;
repeat(5) {
// do something with i
i += 1;
}
The text was updated successfully, but these errors were encountered:
Right now, we do not ask students to do anything with loops because they interact poorly with the fact that our editor evaluates the program as soon as the code parses. This is problematic, because you could be in the middle of writing out something like:
which will run forever, promptly locking up the UI.
@dhmquan and I briefly discussed a
repeat
construct that would not have this same issue. E.g.,One downside is that this construct does not provide a lexically-scoped loop variable like
for
. However, I think that this is OK. First, this is a learning tool, not a production language. Second, one can easily introduce a loop variable with:The text was updated successfully, but these errors were encountered: