3 ms·
This is what happens when we eliminate shop class. Sand this table leg. Good. Now do that three more times. Kids used to know loops before they ever touched a c
by tedunangst 2y ago
This is what happens when we eliminate shop class. Sand this table leg. Good. Now do that three more times. Kids used to know loops before they ever touched a computer.
- klyrs 2y agoExactly. Go make a table with 4 legs and also every leg has 4 legs. Now you get recursion and a very steady table. You were a kid in shop class. Now you want your kids to take shop class. Because, recursion.
- adwn 2y ago> Go make a table with 4 legs and also every leg has 4 legs. If you have to make up nonsensical examples to prove your point, then you probably don't have a point. > You were a kid in shop class. Now you want your kids to take shop class. Because, recursion. That's not recursion.
- svachalek 2y agoC doesn't have a "do this 3 times" loop though. It has an "initialize counter to 0 first, increment counter after each operation, and compare the counter to 3 (or is it 4?)" loop. Kids definitely don't get this without being taught.
- salawat 2y ago//Precon: Need 4 legs. Have none. Int counter_of_sanded_legs = 0; do{ Sand_a_leg; Counter_of_sanded_legs++; } While (counter_of_sanded_legs < 4); Need four legs, have none. Doing while I don't have enough. How many legs do I have? 1. Doing. How many legs do I have? 2. Doing. How many legs do I have? 3. Doing. How many legs do I have? 4. Done. Alternatively: for (int i=0;i<4;i++;) { //how we start; whether we repeat; how we update our counter. Sand_leg(); } You only need to sand a leg when you don't have enough legs. These aren't that far off of actual things you'd do moving about. In fact, not realizing that you're distilling something physical into the symbolic is a leading cause of confusion in my experience. A "do x times" dedicated looping construct would be syntactic sugar that detracts from understanding what the underlying semantics are; which if you're teaching how to program is a bad idea. The idea is to have your understanding precede the machine. Not lag behind. You can start screwing around with abstractions after you get the basics. As once you have the basics, you can compose them into any form you want. The rest is just increasing levels of crippling mental illness.