Forum OpenACS Q&A: Response to OpenACS General Stuff

Collapse
Posted by Don Baccus on
Yes, reading Philip's book is a very good idea, though you must read it with a bit of skepticism because aD is doing some things quite differently nowadays than one would imagine from reading it.

That's the problem with books (or any written document) - they get written, the world changes, and they rarely get edited.

But 90% of what's said there still applies to aD's work, though sometimes more in general than in specific.

Adp pages are currently AOL's preferred way to create dynamic web pages, rather than Tcl scripts.  aD doesn't adhere to that philosophy,  and in particular writes pages which do lots of work but generate little or no HTML in Tcl, a choice I agree with.  Adp pages are certainly a lot easier to work with for pages which contain a lot of  HTML.  They're more readable, making it easier for third parties to whack their way through them when trying to understand your code.

Tcl pages are a small program that optionally generate HTML using ns_write statements, or (current thinking) by building a string and returning it at page completion (more efficient).  Adp pages are HTML pages that can contain embedded snippets of Tcl, including code to dynamically generate HTML based on (say) database contents.  If the Tcl is much smaller than the HTML, as mentioned above Adp pages are easier to read as most of the file is pure HTML, and the small snippets of Tcl stick out like a sore thumb.  On the other hand, if little or no HTML is being generated (as when inserting form contents into the database) an Adp page looks like one giant Tcl snippet, and is no easier to read than a plain old Tcl script file.

Don't worry about us flaming you - you've learned an impressive amount  of stuff on your own over the last few months and you'll certainly learn a lot more.