Re: Why PHP is so succesfull?



On 2008-11-29, Robert Maas, http://tinyurl.com/uh3t <seeWebInstead@xxxxxxxxxxxxxxxx> wrote:
From: Trent J <trent@appalachia>
... server-side scripting in Java, which is possible, but it
sounds like a lot of hassle to me.

Are you saying you've never tried it yourself because you perceive
it to be "a lot of hassle" to even get started with the simplest
starting program?
No, I've never written CGI scripts with Java myself. That's why I made
sure that I presented it as an impression rather than an informed
opinion. (I know Java, but I just haven't used it for CGI.)

Do you have an account on any computer that is on
the InterNet, for example a Unix shell account on some ISP, or your
own personal computer which is connected to the InterNet via DSL or
other 24/7 means, and set up to serve Web pages, and set up to be
able to run CGI if only you had some scripts on your machine? If
so, does that machine have Java installed?
Yes to all of the above. And I do have CGI scripts on my machine, just
not Java ones.

If so, have you seen my
CGI hello-plus tutorial
<http://www.rawbw.com/~rem/HelloPlus/hellos.html>
I hadn't before, but I have now.

and if so does CGI/Java *still* seem like "a lot of hassle" just to
get started?
Yes.

I'll admit Java has more boilerplate needed just to
make a minimal program compared to most other languages,
Yes.

but you
can copy and paste that boilerplate from a template, such as from
my sample/demo CGI applications, so it's just a lot of stuff to
*see* in your CGI application, not any big bunch of stuff you have
to write yourself from scratch just to get started.
So? I don't want to waste any more time than I have to, especially when
there are languages available that don't require any of that boilerplate
code. There's too much, as I said before, "syntactic clutter." Compare
all your System.out.println's with (untested):

#!/usr/bin/perl
print << EOF
Content-type: text/html

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3c.org/TR/html4/loose.dtd";>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=us-ascii">
<title>Hello perl</title>
</head>
<body>
Hello world!
</body>
</html>
EOF

Even without Perl's CGI add-ons, this is looking a lot faster to write
than your code. (Probably a lot faster to execute, too.)

Now, I'm not saying that Java doesn't have its place in server side
scripting. But for small applications and simple scripts like this one,
it's way overkill.

Trent
.



Relevant Pages

  • Re: Help with Java CGI
    ... Help with Java CGI ... I'm trying to create a Java CGI to run using the z/OS ... HTTP server, but not having a lot of luck. ...
    (bit.listserv.ibm-main)
  • Java for CGI [was: Why PHP is so succesfull?]
    ... REM> Are you saying you've never tried it yourself because you perceive ... Trent> No, I've never written CGI scripts with Java myself. ...
    (comp.programming)
  • Re: revisiting web development in Perl...where to start?
    ... The CGI specification mandates that each invocation of a CGI ... crowded with no one technology standing out from the crowd. ... (PHP, CF, JSP, ASP, and the like). ... A casual google for one of these PHP scripts (a ...
    (comp.lang.perl.misc)
  • Re: Problems getting Python scripts to run on server
    ... directory its own .htaccess file containing: ... When I tried the scripts in the other folder (the non cgi- ... a .cgi extension instead of being in a cgi-bin directory. ... AllowOverride FileInfo ...
    (comp.lang.python)
  • Re: Python equivalent of Perl-ISAPI?
    ... I need something that will do cgi scripts (a lot of which I already ... Except I need cgi, not asp, for the reasons i gave. ... Python or Perl. ...
    (comp.lang.python)