"Tinkering with Perl" looks like it would need an overhaul.
The real tiny baby steps are good, but there's no strict, warnings, lexical scope etc. | [reply] |
"Tinkering with Perl" looks like it would need an overhaul. The real tiny baby steps are good, but there's no strict, warnings, lexical scope etc.
The author explains his method in the prefaces. Those topics are far too advanced to start teaching children a language. When I learned English as a child the first day was spent learning about the letter A. We had to write A over and over again on weird green paper between horizontal lines. It took a lot of practice to get the A consistently between the lines. We did the same thing every day for all the capital letters, but only after we mastered the previous letter. Then we learned that there is another version of letters called lowercase and we had to repeat the drill of writing each lowercase letter over and over, until we got it right. There was no mention of advanced topics like vowels, consonants or punctuation at the earliest stages of language acquisition because that would confuse and bore and ruin the child's ability and desire to learn. Remember we're talking about children here, potentially very young children.
| [reply] |
Those topics are far too advanced to start teaching children a language.
"Perl Baby-Talk" is perfectly fine. But speaking of "too advanced": the old ampersand-style function calling is not necessary, nor is predeclaring subroutines, in fact, sub &TellPrice(); is wrong and throws an error - the oldest Perl I have on hand is 5.6.2, so I'm not sure if it ever was legal.
As for strict, warnings, and diagnostics, the code samples on that page include errors that would have been caught by them. $ShouldContinue == "n" would have been caught by warnings, and the following incorrect code from the page would have been caught by strict (and hinted at by warnings):
sub ReadLine()
{
$UserInput = <>;
chomp $userinput;
return $userinput;
}
that would confuse and bore and ruin the child's ability and desire to learn
First option: Three lines of boilerplate, a my in front of variables, and that gets you error messages like: did you forget to declare "my $userinput"?
Second option: Figure out the bug all on your own. I personally think this is the one that would confuse and frustrate a child - just like it's frustrated quite a few adult programmers...
Minor updates to wording. | [reply] [d/l] [select] |
- what haukex wrote
- OP doesn't sound like a child. Baby steps are fine, anyway, but things like my are important concepts.
| [reply] |
on weird green paper between horizontal lines
the equivalent of this would be
use strict;
use warnings;
use diagnostics; # training wheels ;-)
use autodie;
| [reply] [d/l] |