3 ms·
Along those lines, I think CS 106A from Stanford may be the best intro I’ve ever seen. It uses Karel the Robot, which is a kind of pseudo-code robot written in
by austenallred 9y ago
Along those lines, I think CS 106A from Stanford may be the best intro I’ve ever seen.
It uses Karel the Robot, which is a kind of pseudo-code robot written in a Java environment. So you’re trying to use code to solve problems, and use code composition techniques to make it happen.
For example, Karel can’t turn right, so you need turnLeft(); three times. But that’s a pain, so create a turnRight() method that tells Karel to turn left three times. And just like that you understand function composition and why you need functions.
Similar problems force you to use every low-level aspect of programming, including loops, variables, solving off by one errors, etc. And by the time you’re done you’re actually using classes and kind of accidentally writing Java, without fully understanding that’s what’s happening.
I consider it a work of art, and which someone would make an open source, extensible Karel environment that’s really well done and supports other languages. In fact I may just build it.
- janekm 9y agoSounds like that must have been the inspiration for Swift Playground for iPad, which is also a great teaching resource though aimed at kids. It uses the very same turnRight example.