I agree with your statement about the need for a novice CGI book (that's why I wrote one). And Ms. Castro's book isn't the worst example of a book that teaches the topic. The presentation technique is unique and appropriate for the medium. I find it nearly impossible to teach CGI without drawing lots of pictures and waving my arms. 4/5 illustrations in my book appear in the CGI chapters. Writing a book in a novel format like this must have been excruciating and she did a fair job. The explanations are clear and for the most part accurate. CGI can be a hard topic to wrap your head around.
Using strict, -T and -w are good things to use when appropriate. They're not always needed. I present -T, and use it sometimes, but for the most part in these 15-20 line scripts I don't need it. And just putting -T at the top of every CGI script just because "well, that's what you do!" is just as Cargo Cultish (Randal's term) as cutting-and-pasting from Matt Wright scripts.
It so happens I used -w everywhere. Cargo Cultish? Naw. -w catches silly user typos ("used only once..."). It also seems I used strict everywhere after chapter 8. Why? For 'strict vars' mostly because I'm consistantly encouraging "self-contained" functions and argument passing and this helps you to remember to create block-scoped lexicals. Nothing more.
I don't like the explanation of how to untaint without full examples though. I deferred to perlsec here. I would have hoped there was at least a passing reference to it in her book, but I don't see one. One demerit.
Moving on... Even if the HTML were incorrect, this isn't an HTML book and isn't the place to teach it. I wouldn't expect proper and compliant HTML in a Perl/CGI book. And teaching it would obscure the topic at hand. You have to allow for some handwaving.
Speaking of handwaving. The three foreach loops? That may be appropriate for a beginners book too. Sometimes you want to take small bites, and this example DOES have three functions: display a before list, alter the list, display the after. It'd be cute (and FASTER!) to roll it all up into 2 or 1 loop. But when you're teaching new programmers (not just new Perl programmers) you have to take small steps.
Not using CGI.pm? Well, that I don't like. I'm not a big fan of CGI.pm, but at the very least it saves space in the listings for showing CGI techniques and less space for encoding/decoding things. Bad editorial decision. I think this is the only point I agree completely on.
And on a more personal note. This tone was very poor, Ovid. It is possible to give a bad review of a work and still be gracious and civil. In a public forum we should strive to be cultured and thoughtful. Bitch sessions are best done over a beer. Catch me at a conference sometime, and I'll buy you one.
In reply to Re: Perl and CGI for the World Wide Web
by clintp
in thread Perl and CGI for the World Wide Web
by Ovid
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |