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. |