Server-side HTML hell
Last time I weighed Python against Java in a few ways that I hoped would not
rekindle the age-old Python versus Java wars. This week I intended to introduce
the topic of Python programming for web applications. But I really can't do
it justice unless I say a few words about an even touchier duo than Python versus
Java; Python versus PHP, or Hypertext Pre-Processor.
Whether you are a fan of Python, PHP, or both, you're bound to react to this
introduction with disbelief, wondering why I would be foolish enough to make
such an apples to oranges comparison. But it isn't really that odd if you consider
that Python Server Pages (PSP) work pretty much the same way as PHP. Python
Server Pages allow you to intertwine HTML with Python. The PHP language is also
integrated with HTML into executable pages. The programming philosophy is basically
the same in either case.
The strength of PSP and PHP, as well as with the other server page approaches
like JSP and ASP, is that you get to crank out HTML and program code at the
same time. The weakness is that you get to crank out HTML and program code at
the same time.
Good applications have three layers; presentation layer, data layer, and application
logic layer. It's bad enough that people usually don't expend the effort to
separate the data layer from the application layer when they write code. It's
even worse when you have the presentation layer (HTML) so tightly integrated
with your program's logic. It usually leads to a mess that is difficult to maintain.
And that is what I don't like about PSP or PHP.
The difference between PHP and Python as languages is that it is more natural
not to integrate HTML with Python. I'll get into more detail next week, but
there are ways to program web applications in Python the same way you would
program any other application in Python. This approach tends to free you from
the kind of twisted HTML hell that PHP often encourages. And it usually leads
to a more modular approach to building web applications.
Before you PHP fans go off on a rant, allow me to point out that HTML hell
is not a necessary consequence of using PHP. It is simply the usual result,
at least based on the PHP code I've looked at including but not limited to PHP-Nuke.
If you are willing to put in the effort, you can write quite elegant code, even
object-oriented code, using PHP. The problem is that it is so easy to integrate
PHP with HTML that it is difficult to resist the temptation to
Symantec Backup Exec 12 and Backup Exec System Recovery 8 deliver industry leading Windows data protection and system recovery. Download this whitepaper to find out the top reasons to upgrade and how to get continuous data protection and complete system recovery.
Data and system loss — from a hard drive failure, malicious attack, natural disaster, or simple human error — can happen anytime. Don’t leave your business vulnerable. Make sure you have a secure recovery strategy in place. Symantec's latest backup and system recovery technology can efficiently restore critical applications, individual emails and documents and even restore your entire system in minutes in the event of a loss.
Businesses face a growing challenge to ensure that the IT environment is properly protected. Backup Exec 12 integrates with other applications in the Symantec family of products, to complement your current data protection strategy, keep your data securely backed up and make it recoverable when you need it most.







