Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

I hate HTML functions

by swiftone (Curate)
on Oct 06, 2000 at 22:29 UTC ( [id://35637]=note: print w/replies, xml ) Need Help??


in reply to Beginnings of Online CGI Course

  • Bad code
  • Speeling errors :)
  • Readability
  • Accuracy
  • Broken links (the link for Appendix One is broken. I'll get to it eventually)
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

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2024-03-28 21:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found