http://www.perlmonks.org?node_id=539720

While they certainly aren't ready for it yet, I look forward to one day helping my children learn about programming. I think that, with a good set of exercises, a lot of different analytical tools could be taught in a very interactive, "let me see results," non-theoretical way that would be great at stimulating and maintaining interest. Turtle Tracks is out there, so Logo is still an option (no perl implementations?!) Anyway, it got me thinking...

Instead of another interpreter, it would be neat to see some pragmas for perl created specifically for teaching programming concepts. It would help guide the student's progress by encouraging and allowing different usages, much as strict does now, but slightly more B&D. Like training wheels, however, the restrictions could be progressively loosened lesson by lesson, or piece by piece. Like diagnostics, more informative (to the novice) error messages could be provided. Bundle it with some Tk and custom lesson modules, accompanied with a good e-book, and it could easily be adopted by schools at low cost (while providing plenty of market for an instructors manual or two...)

Best of all, when they finish the course and all the restricitons are off, you have a class full of perl hacklings!
OK, there's my hairbrained idea for the day, off to work...

I'll try to maintain a list of related links below:

Previous similar perlmonks discussions
How to introduce 8 year olds to (Perl) programming?
Teaching Perl to children
Where and how to start learning Perl (not child specific but extensive)

Related Links
Logo in Java: Turtle Tracks
Smalltalk via Squeak!

"One is enough. If you are acquainted with the principle, what do you care for the myriad instances and applications?"
- Henry David Thoreau, Walden

Replies are listed 'Best First'.
Re: Teaching aid pragmas (perlite?)
by merlyn (Sage) on Mar 28, 2006 at 16:21 UTC
    I've often wished for a "training perl" for the llama class that disabled the return value of chomp, forbid the use of map and grep in a void context, and removed array slices, amongst other things.

    -- Randal L. Schwartz, Perl hacker
    Be sure to read my standard disclaimer if this is a reply.

      I'd be wary of changing the behavior of return values, as it seems like the sort of thing that someone would write code expecting one behavior on a 'user friendly' version, and then be surprised when their code broke horribly when using a 'full' version of Perl.

      Not quite a perl example, but I worked at my university's computer support center during my undergrad. The engineering school had aliased 'rm' to 'rm -i' on all of the boxes they maintained ... someone had an account on one of our 'normal' systems, and to clean up their directory typed 'rm *', expecting it to behave like 'rm -i *'. Needless to say, they were not happy to have lost the training wheels, as our policy on backups was for catastrophic recovery, not as an 'undelete'.

Re: Teaching aid pragmas (perlite?)
by kutsu (Priest) on Mar 28, 2006 at 15:41 UTC

    Sounds interesting, and what with CPAN you could create a few modules to do that, but I've always preferred physical examples to teach programming concepts (to children): as I already explained in How to introduce 8 year olds to (Perl) programming?, which also has a lot of other nice ideas.

      Thanks for the link kutsu!

      "One is enough. If you are acquainted with the principle, what do you care for the myriad instances and applications?"
      - Henry David Thoreau, Walden

Re: Teaching aid pragmas (perlite?)
by jthalhammer (Friar) on Mar 30, 2006 at 09:07 UTC
    I don't know if it is suitable for children, but if you think of Conway's "Perl Best Practices" book as a teaching guide, then the criticism pragma might be just what you're looking for.

    -Jeff

      That sounds very much like what I had in mind! Nice work, jthalhammer- a great idea.

      I would probably look to criticism for the review mechanism, but use different criteria, based on a lesson plan, to disallow even some functions and structures that are proper perl and within the "best practices." The criteria would be gradually loosened as the lesson progressed and introduced new tools to the students.

      criticism would be a great "post grad" recommendation, or exta credit challenge on assignments- see what level of criticism a student's code will pass thorugh unscathed.

      "One is enough. If you are acquainted with the principle, what do you care for the myriad instances and applications?"
      - Henry David Thoreau, Walden

        If you give me a few more specific examples, I can probably whip up something for you. Perl::Critic is very configurable & extensible. For instance, we could create a policy that would let you prohibit (or require) the use of an arbitrary set of builtin functions. Or limit the number of statements or operators or subroutines that you're allowed to use. I believe Perl::Critic has real potential as a teaching tool, so I'm genuinely interested in hearing your ideas.

        -Jeff