Portability benefits
All you need is a browser on clients. On the upside, because PyMailCGI runs over
the Web, it can be run on any machine with a web browser, whether that machine
has Python and tkinter installed or not. That is, Python needs to be installed on
only one computer—the web server machine where the scripts actually live and
run. In fact, this is probably the most compelling benefit to the web application
model. As long as you know that the users of your system have an Internet browser,
installation is simple. You still need Python on the server, but that’s easier to
guarantee.
Python and tkinter, you will recall, are very portable, too—they run on all major
window systems (X11, Windows, Mac)—but to run a client-side Python/tkinter
program such as PyMailGUI, you need Python and tkinter on the client machine
itself. Not so with an application built as CGI scripts: it will work on Macintosh,
Linux, Windows, and any other machine that can somehow render HTML web
pages. In this sense, HTML becomes a sort of portable GUI API language in web
scripts, interpreted by your web browser, which is itself a kind of generalized GUI
for rendering GUIs. You don’t even need the source code or bytecode for the CGI
scripts themselves—they run on a remote server that exists somewhere else on the
Net, not on the machine running the browser.
Execution requirements
But you do need a browser. That is, the very nature of web-enabled systems can
render them useless in some environments. Despite the pervasiveness of the Inter-
net, many applications still run in settings that don’t have web browsers or Internet
access. Consider, for instance, embedded systems, real-time systems, and secure
government applications. While an intranet (a local network without external con-
nections) can sometimes make web applications feasible in some such environ-
ments, I have worked at more than one company whose client sites had no web
browsers to speak of. On the other hand, such clients may be more open to instal-
ling systems like Python on local machines, as opposed to supporting an internal
or external network.
Administration requirements
You really need a server, too. You can’t write CGI-based systems at all without
access to a web server. Further, keeping programs on a centralized server creates
some fairly critical administrative overheads. Simply put, in a pure client/server
architecture, clients are simpler, but the server becomes a critical path resource
and a potential performance bottleneck. If the centralized server goes down, you,
your employees, and your customers may be knocked out of commission. More-
over, if enough clients use a shared server at the same time, the speed costs of web-
based systems become even more pronounced. In production systems, advanced
techniques such as load balancing and fail-over servers help, but they add new
requirements.
Web Scripting Trade-Offs| 1295