in reply to Beginnings of Online CGI Course

All good. My one complaint is the use of the CGI.pm html functions. I, personally, find those less readable, and often counter-productive (I don't like mixing content and code so tightly).

I know it's a personal preference, but I thought I'd throw it out there. Otherwise everything looks great. I like the emphasis on good practices early on. Will you be introducing CGI::Carp?

Replies are listed 'Best First'.
(Ovid - why I used HTML functions in the course)
by Ovid (Cardinal) on Oct 06, 2000 at 23:02 UTC
    First, I do plan to introduce CGI::Carp.

    I recommend that the people take the course learn to use the CGI.pm HTML functions for several reasons:

    • If they work on anyone else's CGI scripts, they are likely to encounter them sooner or later, so they should know them.
    • Because CGI.pm is creating your HTML for you, it provides a rough syntax check of the HTML. You can't get that with a here doc or with HTML::Template.
    • You can't forget to close your tags (why, just today I fixed a table that someone forgot the closing table tag. Too bad for Netscape).
    • It's tough for them to decide if they like these functions if they never use them.
    I plan to introduce a variety of methods of creating the HTML, so that people taking the course can see the pros and cons of different methods (TIMTOWTDI). It's tough to evaluate something you have never used. I hate multiple print statements and a here document is not much better. Obviously, for large sites, mixing code and HTML is a nightmare. At the very least, the HTML functions are code as opposed to markup tags. I won't demand that the people taking the course use any one method, but I will ask that they at least be familiar with them.

    Cheers,
    Ovid

    Join the Perlmonks Setiathome Group or just go the the link and check out our stats.

      The HTML functions also permit me to use Emacs to find the nestingness of each tag, and there are a lot of high-level functions that aren't 1-to-1 with HTML that shortcut many things. When's the last time you had to do an option-list by hand? It's so much easier with the shortcut! And using the HTML functions, I get sticky fields and HTML-escaping of defaults for free!

      -- Randal L. Schwartz, Perl hacker