|
|
|
|
|
by mohamedsa
5160 days ago
|
|
From testing with a few children, I do feel that Basic's mandatory line numbers make usage of goto much more easier to learn. I did have to spend some time explaining labels to my students. So I kind of agree with your hunch! I don't know with what to replace it though, it always seemed like a choice between structured loops which have their own problems (the need to explain blocks) or the return of line numbers... Your third scheme is a new option, but not without drawbacks. The advantage of unrestricted label/goto is that the concept is learned once and applied for many types of control flow. But I think the other main case that needs to be handled is exiting loops. Maybe I could also have an exit <label> keyword, and try with some sample programs to see if it could be sufficient. I'm still inclined towards leaving goto though. I think it's more raw and "operative" in a sense, and more creative kids might be able to come up with fun uses for it (I've recently added computed goto to the language too). Thanks for the insights! |
|