4 ms·
Some Suggestions for Teaching Python
- danso 12y agoAs someone who's tried to teach Ruby to laypersons, this one really stuck out to me: "Distinguishing between returning and printing values" Teaching using the interactive REPL might possibly be an anti-pattern when it comes to teaching a language. I mean, it's great to introduce, but walking through concepts with it can be quite painful: 1. When you get into unclosed brackets and quotation marks, beginners are often confused why nothing happens even after pressing "Enter" a few times. Yes, the prompt does signal an unclosed entity, but it's not obvious to beginners. 2. When you're demonstrating via projected display...it is very hard for students to determine exactly what the hell you're typing, especially if you take advantage of history-autocomplete shortcuts. Yes, such a thing is so mind-numbingly obvious to a moderately experienced programmer, but it is not at all the case for newbies. 3. If you're writing a sequence of commands...not only do you not have to make a typo, but so do your students. Try diagnosing a cry of "It didn't work!" when there are 3 to 4 lines that could have any variety of typographical error. I think getting into the REPL to do "hello world" is fine...and it's probably necessary to show some basics about variables...but afterwards, it seems much more efficient to get into writing script files and executing them via command line than it is to continue using the REPL.
- teach 12y agoAgreed on all fronts. The article has some decent suggestions, but they seem INCREDIBLY elementary to me as a person who has made a career of teaching programming to beginners. In fact, just did a back-of-the-envelope calculation. In an extremely conservative estimate, I have spent more than 30,000 hours working face-to-face with students teaching them how to code. Actually I guess this explains why everyone sucks at teaching coding: nobody has enough experience.
- japhyr 12y agoI also think about the fact that students want to write actual programs, rather than just code in terminal sessions. So it's okay to show some quick ideas in a terminal session, but my rule of thumb is that anything requiring indentation should be demonstrated through a short program file. This makes it easier to help students fix small errors, and it gives them practice working with many small program files.