Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Perl High School Graduation

by thunders (Priest)
on May 20, 2002 at 15:43 UTC ( [id://167850]=note: print w/replies, xml ) Need Help??


in reply to Perl High School Graduation

A few comments on your curriculum in general. It looks like you may come from a C/C++ back ground or that perhaps you are using perl as a C primer.
One thing that's a pet peeve of mine is the C-style for loop, when it is not necessary.
for($a=0;$a<10;$a++){...}
is more idomatically written as
for(1..10){...}
But that's just nitpicking, one thing i saw that I would definately recommend against is assigning file contents to arrays. It's better to process files in real time line by line especially for large files. That way perl doesn't have to keep track of (dozens||hundreds||thousands) of array elements.
@lines = <FILE>#potentially expensive #a bit better while(my $line = <FILE>){ chomp $line; ...do something with $line }
Hope you find some of these comments useful, overall I would say that your course looks great, and that you seem to be commited to teaching Perl over PERL. And that's always good to see. Perl's object oriented features are best introduced through modules. I would focus on using CGI, DBI, LWP, Tk, the HTML::Parser series. For beginner and even advanced Perl Programmers being able to effectively use existing modules is a necessity.
Show how modules are useful first, and make sure the students understand subroutines, references and hashes inside out. You may want to leave the details of OOP for an advanced class. An excellent, but challenging textbook for this is Damian Conway's Object Oriented Perl.

Replies are listed 'Best First'.
Re: Re: Perl High School Graduation
by hsweet (Pilgrim) on May 20, 2002 at 19:01 UTC

    Never touched the stuff (C or C+). Learning Java though. I'm trying (maybe not too well) to teach Perl as Perl to the degree I understand it. At the same time, I want the students to have a grasp of general programming constructs that apply to other languages

    You are right about the other points, though. Although I like being able to toss an entire file into an array, it could bog things down.

    My class has used the CGI and LWP::simple modules, but not in OOP style. I'm demonstrating Tk. I'm not silly enough to think beginners will be able to leave my class and write Perl objects. Or understand them. They need to be able to at least recognize things like my $button=$mainwindow->new(); and know that there is an object being made from a module. I'll be happy if they get that far.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://167850]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (4)
As of 2024-04-25 09:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found