Re: Why PHP is so succesfull?
- From: Trent <trent@xxxxxxxxxxxxxxxxxx>
- Date: Mon, 01 Dec 2008 09:11:41 -0600
On 2008-11-29, Robert Maas, http://tinyurl.com/uh3t <seeWebInstead@xxxxxxxxxxxxxxxx> wrote:
No, I've never written CGI scripts with Java myself. That's why I madeFrom: 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?
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 onYes to all of the above. And I do have CGI scripts on my machine, just
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?
not Java ones.
If so, have you seen myI hadn't before, but I have now.
CGI hello-plus tutorial
<http://www.rawbw.com/~rem/HelloPlus/hellos.html>
and if so does CGI/Java *still* seem like "a lot of hassle" just toYes.
get started?
I'll admit Java has more boilerplate needed just toYes.
make a minimal program compared to most other languages,
but youSo? I don't want to waste any more time than I have to, especially when
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.
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
.
- Follow-Ups:
- Re: Why PHP is so succesfull?
- From: Robert Maas, http://tinyurl.com/uh3t
- Re: Why PHP is so succesfull?
- Prev by Date: Re: Linux Sockets UDP and fragmentation
- Next by Date: Re: SQL-procedural language
- Previous by thread: Re: Lock-free reference counting
- Next by thread: Re: Why PHP is so succesfull?
- Index(es):
Relevant Pages
|