Re: simple web programming options

From: Chris Williams (thesagerat_at_yahoo.co.jp)
Date: 02/15/05


Date: 15 Feb 2005 01:05:23 -0800

crichmon wrote:
> Most of my programming experience is with C++. I have a decent
knowledge of
> HTML and have made several simple web pages in the past. My current
project
> is to create a web page whose content is based on a database of
information.
> What are some different options for storing information and
generating web
> content dynamically?

Apache/PHP/MySQL is probably the fastest to get up and running on
either Windows or Unix/Linux. And that I have seen from CGI/FCGI, Java
Servlets, and ASP; PHP seems to provide the best API of ready-to-use
functions for everything you could ever want to do on a web server or
to a webpage.

CGI/FCGI:
These are essentially console applications that have stdout pointed to
the user. So you just write out a webpage and that's what the user
gets. CGI restarts the application each time, while as FCGI will start
your app once, and you have an eternal loop that scoops up requests and
responds to them.
You can create CGIs in anything from C to Perl. I would imagine that C
or C++ would be faster (though with FCGI I would be worried about
memory leaks), but Perl has various modules that you can include for
doing CGIs specifically and scripted access to databases.
Setting up FCGI on Windows under Apache at least is not easy.

Java Servlet:
>>From my two seconds looking at it, it would appear that the Java
Servlet API is similar to standard Java and has an object for
everything in world, each with 80 functions and inheriting another 200
from various parent objects. So my guess would be that there will be a
lot of time spent searching through the API for the correct function
(of 20 possibles.)
I have no idea how easy or hard it is to get a Java Servlet capable
development environment and/or production server set up.

ASP:
In Windows, you can get IIS running on your own machine in a few
moments and ASP is already there. ASP itself is not a very robust API
for doing much of anything including webpages. The default language
(VBScript) is also not very robust and tends to require about twice the
amount of text as it seems it should to do anything.
And though I haven't ever particularly timed anything, asp(x) pages on
the internet always seem to be the slowest when browsing--but that
might just be a matter that asp(x) pages tend to be used by large
corporations who possibly have lots of traffic, very large databases,
and complex pages.

So as said, I recommend PHP highest for language. MySQL will be fastest
to get running and provides the most user-friendly toys, but all of
those toys are entirely incompatible with Oracle and Postgres which
tend to be fairly nuts-and-bolts only. Postgres is easy to download,
install, and get running and from what I hear from DB geeks is robust
enough for real web applications (and MySQL is supposedly not.) And
since it doesn't have the toys, if you have to port to Oracle or some
other "serious" DB you will have to change a lot fewer SQL queries.
If you think you will be switching databases, you might want to wrap
the PHP functions in a generic object, as there is a different API for
each database family.

However, my two beefs with PHP are that it automatically creates
variables without them needing to be initialized (so a mispelled
variable can cause havoc), and variables are visible outside of the
block they are created (so a variable you might have been expecting to
get cleared and reinitilised in a loop will still have its old value
the next time through.) Unfortunately these didn't bite me until a good
ways through a very substantial web-application, but if I were to do
such a program again, I would recommend that anytime you want to use a
variable set it to null before use as a sort of soft declaration. That
will at least solve the second problem.

-Chris



Relevant Pages

  • connect databases via http
    ... Do you know of any means to connect two Oracle 10g databases via http ... or https without using a middle tier (php, java, whatever...)? ...
    (comp.databases.oracle.server)
  • Re: Shortage of qualified Java programmers
    ... library of Java is what you have computers for -- not people. ... every detail of the API. ... to figure out how a Comparator works given the Javadocs. ... programmers written by Bill Venners. ...
    (comp.lang.java.programmer)
  • Re: Shortage of qualified Java programmers
    ... candidates are very hard to come by in the Atlanta area. ... that a candidate will list every Java technology in the world on his ... API test.) ... questions might be too easy for programmers with 3+ years Java experience. ...
    (comp.lang.java.programmer)
  • Re: Shortage of qualified Java programmers
    ... Good candidates are very hard to come by in the Atlanta area. ... I don't know whether there is an actual shortage of Java programmers in the U.S., or whether the situation is unique to our metro area, or whether we are just relying on the wrong recruiting companies. ... API test.) ...
    (comp.lang.java.programmer)
  • Re: CLOS and databases
    ... > socks off the Java people, so I really want to do this the Right Way. ... Current O/R mapping products include more or ... support for caching; ... support for all major databases (with the possibility to let you write ...
    (comp.lang.lisp)