On 3 March 2012 10:58, John Yeung gallium.arsenide@gmail.com wrote:
I'm also going to chime in that I think the best way to handle boilerplate is to put it in a separate module, and to load it via a magic "import" incantation at the top.
I have to agree with John, what you should do is delete the system templates in all the other languages and create a set of Python templates, one for each exercise the students have to do. Then the new from template drop down will show the list of exercises.
Each Python file can describe the exercise in comments at the top and include imports or other boiler plate as well as any hints you want to give.
If the kids delete the import, thats a learning experience :) and they can always create a new one from the template.
Not only does this keep things out of the way, but it's editor-independent and settings-independent. And user-input-independent! If you rely on folding, you KNOW someone is going to either accidentally or through curiosity hit the unfold button.
Just like I accidently hit fold when trying to select whole lines :) I hope the kids don't learn the sort of language I use then.
If even a single import line is too scary, then I'm not sure these kids are ready for programming. At least not in Python (which I agree is already a pretty learner-friendly language). There are other languages/environments specifically designed for *kid* programming, like Alice (http://www.alice.org/). In a pinch, you could use Python's interactive prompt and turtle module as a kind of Logo (not sure if this is the way Kevin meant, but I agree with him that Python's turtle module is way cool, even as an adult).
But of course it all has to fit in Raspberry Pi's minimal memory.
Cheers Lex