Rob wrote:
[color=blue]
> i know javascript, vbscript, asp css and alot more and im only 14 i was
> wondering which is easier to learn php or cgi. any help?
>[/color]
CGI isn't a language...
PHP, Perl, C, C++, Python, TCL, shell scripts, etc. can all be used to
create CGI scripts. (In some cases, VisualBasic, etc. can as well...)
PHP has been tagged as an easy-to-learn language. Depending on your
experience with programming and problem solving, learning new languages
becomes just a matter of syntax differences and memorization.
Instead of asking which is easier to learn, try finding resources that
teach programming practices, design patters, etc. in a genera sense,
then just apply it to the language-of-the-day (or project).
If you know ASP well, you may want to start checking into the .NET
aspect and new features. ASP and PHP are *very* similar in what they do,
but just as different in how it is accomplished. If you know c-style
language syntax, php shouldn't be any problems. Perl would be about the
same, just a slightly higher learning curve.
assuming you are talking about perl when you say cgi, i would say php is
a bit easier to learn. it was built specifically for web applications
whereas perl was ported over to the web (in a way).
Rob wrote:[color=blue]
> i know javascript, vbscript, asp css and alot more and im only 14 i was
> wondering which is easier to learn php or cgi. any help?
>[/color]
.oO(Rob)
[color=blue]
>i know javascript, vbscript, asp css and alot more and im only 14 i was
>wondering which is easier to learn php or cgi. any help?[/color]
CGI is no particular programming language, it's kind of a communication
protocol that controls the way a webserver communicates with external
programs. You can use almost every language for writing CGI programs:
scripting languages (Perl, Python, ...), compiled languages (Pascal, C,
C++, ...), whatever. Even PHP itself runs as CGI on many servers.
On Tue, 08 Mar 2005 10:25:37 -0800, Rob wrote:
[color=blue]
> wondering which is easier to learn php or cgi. any help?[/color]
Which one? CGI? or PHP?
Seriously, though, CGI is not a programming language, it is a data
interface paradigm. A set of standards that describe how data should go
back and forth. A generic dexcription that can be implemented in basically
any programming language.
And in answer to your question, learn:
PHP
Java
C
C++
HTML
Perl
Python
Not necessarily in that order. And that's just my opinion, of course.
Ask yourself, what do you want to do? Where do you want to do it? The
tool (programming language) should fit the need.
"Donnie" <dqmillar@REMOV E-THISyahoo.com> wrote in message
news:aeeec$422d fc28$ccf6844e$1 879@VIAWEST.NET ...[color=blue]
> assuming you are talking about perl when you say cgi, i would say php is
> a bit easier to learn. it was built specifically for web applications
> whereas perl was ported over to the web (in a way).
>
> Rob wrote:[color=green]
> > i know javascript, vbscript, asp css and alot more and im only 14 i was
> > wondering which is easier to learn php or cgi. any help?
> >[/color][/color]
Something i saw at a web site the other day:
"Perl combines all the worst aspects of C and Lisp: a billion different
sublanguages in one monolithic executable. It combines the power of C with
the readability of PostScript."
On Tue, 8 Mar 2005 19:22:20 -0500, "Chung Leong" <chernyshevsky@ hotmail.com>
wrote:
[color=blue]
>Something i saw at a web site the other day:
>
>"Perl combines all the worst aspects of C and Lisp: a billion different
>sublanguages in one monolithic executable. It combines the power of C with
>the readability of PostScript."[/color]
Since PHP is quite Perl-like [1] - being originally written _in_ Perl back in
the days of PHP/FI - the same accusations could be directed at PHP. (and they'd
still be wrong, IMHO - have you actually _seen_ Postscript? Ouch).
Pretty much all statements such as the above are good for is inciting
flamewars. Most Turing-complete languages [2] have their niche somewhere - PHP
is particularly good in web applications, and it's a damn sight easier to get
set up in a performant way (as an Apache or SAPI module) than mod_perl is. Perl
remains a very strong batch application language.
[1] Except without namespaces, fancy quoting operators, native Unicode support,
native regular expression support, a well-populated unified module repository
[PEAR does not compare well with CPAN], etc.
Chung Leong wrote:
[color=blue]
>
> "Donnie" <dqmillar@REMOV E-THISyahoo.com> wrote in message
> news:aeeec$422d fc28$ccf6844e$1 879@VIAWEST.NET ...[color=green]
>> assuming you are talking about perl when you say cgi, i would say php is
>> a bit easier to learn. it was built specifically for web applications
>> whereas perl was ported over to the web (in a way).
>>
>> Rob wrote:[color=darkred]
>> > i know javascript, vbscript, asp css and alot more and im only 14 i was
>> > wondering which is easier to learn php or cgi. any help?
>> >[/color][/color]
>
> Something i saw at a web site the other day:
>
> "Perl combines all the worst aspects of C and Lisp: a billion different
> sublanguages in one monolithic executable. It combines the power of C with
> the readability of PostScript."[/color]
When I look at Perl code I always think it reminds me of something that
should be inscribed in a pyramid, mystic runes and hieroglyphics. Got
tired of trying to find out what a free floating line like <> could
possibly mean.
I sometimes wonder if Larry Wall's assignment on this planet will end soon
and he will report his findings about humans to his overlords in the land
of half-mad hacker geniuses.
--
Kenneth Downs
Secure Data Software, Inc.
(Ken)nneth@(Sec )ure(Dat)a(.com )
JDS wrote:
[color=blue]
> On Tue, 08 Mar 2005 10:25:37 -0800, Rob wrote:
>[color=green]
>> wondering which is easier to learn php or cgi. any help?[/color]
>[/color]
Why do you want to learn something because it's easy? If you want useful
computing skills, then you should be getting as wide an exposure to
different programming methodologies as possible.
[color=blue]
> And in answer to your question, learn:
>
> PHP
> Java
> C
> C++
> HTML
> Perl
> Python
>[/color]
PHP is certainly easy to develop with (IMHO, except for HTML, the easiest of
the above) but I'd say have a go at:
PHP - as an introduction to programming
C - for procedural programming
Smalltalk - for OO programming (Java has a lot of hangovers from procedural
systems, Python is better but Smalltalk is the genuine article)
SQL - for non-procedural programming. (You could try prolog but there are
only three people in the world who actually get paid to use it)
In: <1110306337.107 181.66030@g14g2 000cwa.googlegr oups.com>, "Rob" <rob.debodt@gma il.com> wrote:[color=blue]
>i know javascript, vbscript, asp css and alot more and im only 14 i was
>wondering which is easier to learn php or cgi. any help?[/color]
I'd say learn CGI, then the other languages will be easier.
Note: you'll probably need a language to learn CGI in, because CGI
is a _protocol_ designed for any language that can deal with standard
input, standard output and environment variables.
If you're looking for an easy language to learn, try REXX. I wouldn't do
anything serious in it, but.. REXX is a good language for learning in.
It doesn't have any CGI centric features that I am aware of, therefore
using REXX to write CGI programs is an excellent learning choice, you
will have to parse the urlencoded data yourself. This will give you a better
understanding of what is happening. Don't waste too much time in REXX, just
use it to get the basics. (You won't have much use for it later on, except
maybe on a palm pilot)
After that, I'd go with perl, perl is nice because it's much more than CGI.
Don't *start* with perl though, perl is a horrible first language. You'll
probably never "fully learn" perl. I've been at it for many years and still
discover new tricks now and then. Perl is fun, but it lets you shoot yourself
in the foot quite easily. Don't start with it or you'll contaminate your
mind. :-)
PHP would be next on the list. (PHP has a lot of stuff borrowed from perl, if
you know perl, PHP will be a breeze)
Somewhere either before or after perl, java wouldn't be a bad idea.
Anyhow, yea, CGI is easier than any language, assuming you already
know a server-side language.
wrote:
[color=blue]
> In: <1110306337.107 181.66030@g14g2 000cwa.googlegr oups.com>, "Rob"
> <rob.debodt@gma il.com> wrote:[color=green]
>>i know javascript, vbscript, asp css and alot more and im only 14 i
>>was wondering which is easier to learn php or cgi. any help?[/color][/color]
[ .. ]
[color=blue]
> It doesn't have any CGI centric features that I am aware of, therefore
> using REXX to write CGI programs is an excellent learning choice, you
> will have to parse the urlencoded data yourself.[/color]
e.g. reinvent the wheel, and make a zillion bugs, and get frustrated,
write very insecure scripts that can harm you and moreover others (e.g.
sending out hundreds and hundreds of spam messages an hour until closed
down).
[color=blue]
> After that, I'd go with perl, perl is nice because it's much more than
> CGI. Don't *start* with perl though, perl is a horrible first
> language.[/color]
crap
If you base your experience on the garbage found on the net, written by
wannabee web script hackers, yeah. Same holds for PHP.
Learn Perl with a good book, not by downloading shitty scripts.
[color=blue]
> You'll probably never "fully learn" perl.[/color]
That holds for any programming language.
[color=blue]
> I've been at it
> for many years and still discover new tricks now and then.[/color]
Which is good. As soon as you stop learning new programming skills in a
programming language something is wrong with you, not the language :-D.
[color=blue]
> Perl is
> fun, but it lets you shoot yourself in the foot quite easily. Don't[/color]
Then learn not to point a gun at your foot. There is no language that
protect you and guides you to be an excellent programmer. *You* are the
programmer, not the language. *You* have to learn how to write clear and
understandable programs. No language can learn you nor as quite a lot of
people claim counterwise: force you to program clear.
[color=blue]
> start with it or you'll contaminate your mind. :-)
>
> PHP would be next on the list. (PHP has a lot of stuff borrowed from
> perl, if you know perl, PHP will be a breeze)[/color]
Wrong again. PHP is a joke, inspired by Perl, but sadly the developers
had no clue about language design. They dropped stuff from Perl they
clearly didn't grasp and replaced them with clumsy constructs, extremely
bad design and all in the hope that they were creating an "easier"
language.
[color=blue]
> Somewhere either before or after perl, java wouldn't be a bad idea.
>
> Anyhow, yea, CGI is easier than any language, assuming you already
> know a server-side language.[/color]
Don't learn CGI, use the CGI library that comes with the language. It's
guaranteed more bug free then most people can code it themselves.
If you want to learn a general programming language *drop* PHP period.
Make a list of what you want to do / learn, and pick a language.
Languages I would have a peek at:
Perl
Python
C#
Java
Note that Java has nothing to do with JavaScript.
Languages I try to avoid touching, even with a long stick:
PHP
Sadly some people insist on PHP written solutions :-(
In: <Xns9616EB3C94B E0castleamber@1 30.133.1.4>, John Bokma <postmaster@cas tleamber.com> wrote:[color=blue][color=green]
>> It doesn't have any CGI centric features that I am aware of, therefore
>> using REXX to write CGI programs is an excellent learning choice, you
>> will have to parse the urlencoded data yourself.[/color]
>
>e.g. reinvent the wheel, and make a zillion bugs, and get frustrated,
>write very insecure scripts that can harm you and moreover others (e.g.
>sending out hundreds and hundreds of spam messages an hour until closed
>down).[/color]
He's talking abou *learning CGI* not using it. If you want to learn CGI,
you must do a little re-invention of the wheel to get a grasp of how it
works.
For this kind of thing, REXX is an ideal choice. It's simple, it's kind
of like a language with training wheels. (The original spirit of BASIC)
Seems like the BASIC we grew up with has been ruined by people who
didn't want to move on in life, otherwise I'd say "start out in BASIC".
In a *learning* or prototype environment, REXX is an excellent tool. Very
much like BASIC was supposed to be.
Remember, we're talking about learning here... re-invention is quite
appropriate and even encouraged.
I think a 14 year old with decent skill will quickly plow through REXX..
hardest part will be parsing the urlencoded data. (a useful excercise for
anyone learning CGI, even if it's something you'll seldom need to do)
If you DON'T learn CGI in a nuts and bolts level it will be harder to understand
things like why redirects are hosed with the POST method and why the GET
method is some-what limited.
[color=blue]
>If you base your experience on the garbage found on the net, written by
>wannabee web script hackers, yeah. Same holds for PHP.[/color]
So, your first language should be full of context-aware operators, funny
dereferencing things like %{$foo->[5]}.
A language where local($|)=1; is meaningful and appropriate, but local($var)
is bad.
local($HASH{KEY }) works, but my($HASH{KEY}) doesn't, even though you are
supposed to use 'my()' Or wait, use 'my' because of the context it
suggests!.
A culture where a bunch of rude people who tell you to RTFM!!! every time
you're confused about something?
Not my ideal first language. (Though I admit, it is my *perferred* language,
I do like perl, but I had learned a couple others first)
[color=blue]
>Which is good. As soon as you stop learning new programming skills in a
>programming language something is wrong with you, not the language :-D.[/color]
Thats very true.
[color=blue]
>Then learn not to point a gun at your foot. There is no language that
>protect you and guides you to be an excellent programmer.[/color]
We're talking about learning, if I were going to teach someone to aim
a gun, it's very doubtful I'd start them out with a bazooka on horseback
unless I wanted them to fail.
[color=blue][color=green]
>> PHP would be next on the list. (PHP has a lot of stuff borrowed from
>> perl, if you know perl, PHP will be a breeze)[/color]
>
>Wrong again. PHP is a joke, inspired by Perl, but sadly the developers
>had no clue about language design. They dropped stuff from Perl they
>clearly didn't grasp and replaced them with clumsy constructs, extremely
>bad design and all in the hope that they were creating an "easier"
>language.[/color]
Personally, I agree with your sentiment in many respects. The thing I don't
like about PHP is that it's frankly boring. (Also don't like the whole
$_POST/$_GET thing) would be nice if you could parse the data before PHP got
to it.
[color=blue]
>Don't learn CGI, use the CGI library that comes with the language. It's
>guaranteed more bug free then most people can code it themselves.[/color]
Learn CGI if you want. Nothing wrong with learning, having a working
knowledge of what is happening will be useful when you want to do things
like accept an XML document from some other source. If you've always used a
library, you probably wouldn't realize how innefecient PHP's approach
to this can be. Just understanding how the model works has saved many hours
of debugging. I have parsed out urlencoded data manually and I haven't once
regretted the experience.
(Besides, he specifically *asked* about learning CGI)
you have started what's known as a "language war". being 14 and smart
hopefully you have learned a) never to ask such a question on usenet
again, or b) to keep asking such questions cause its fun to troll ;)
you've gotten plenty of good advice, the key piece being that CGI is
not a language, but rather a "protocol", that can be implemented in
several other languages, Perl being the most prevalent.
what you haven't been told is that CGI as a paradigm for web
applications has long been on the decline. this is because for every
request of a cgi program, a new process is invoked on the server. if
your cgi script gets lots of hits, thats a lot of server side
processing. long story short, cgi doesn't scale well.
that being said, i would say that learning PHP will be more useful. a
Perl alternative to CGI is to use mod_perl, but PHP is probably easier
to learn, and certainly more prevalent. whether or not that prevalence
is a good thing is another matter.
wrote:
[color=blue]
> In: <Xns9616EB3C94B E0castleamber@1 30.133.1.4>, John Bokma
> <postmaster@cas tleamber.com> wrote:[color=green][color=darkred]
>>> It doesn't have any CGI centric features that I am aware of,
>>> therefore using REXX to write CGI programs is an excellent learning
>>> choice, you will have to parse the urlencoded data yourself.[/color]
>>
>>e.g. reinvent the wheel, and make a zillion bugs, and get frustrated,
>>write very insecure scripts that can harm you and moreover others
>>(e.g. sending out hundreds and hundreds of spam messages an hour until
>>closed down).[/color]
>
> He's talking abou *learning CGI* not using it. If you want to learn
> CGI, you must do a little re-invention of the wheel to get a grasp of
> how it works.[/color]
Sometimes people write A when they really mean B. This happens
especially when people are new to it.
[color=blue]
> For this kind of thing, REXX is an ideal choice.[/color]
Over Python or Perl? Based on what?
[color=blue]
> It's simple, it's[/color]
I have quite some programming experience but never seen an easy
programming language.
[color=blue]
> If you DON'T learn CGI in a nuts and bolts level it will be harder to
> understand things like why redirects are hosed with the POST method
> and why the GET method is some-what limited.[/color]
You don't need to learn the inner gory details of CGI to understand
that.
[color=blue][color=green]
>>If you base your experience on the garbage found on the net, written
>>by wannabee web script hackers, yeah. Same holds for PHP.[/color]
>
> So, your first language should be full of context-aware operators,
> funny dereferencing things like %{$foo->[5]}.[/color]
Every language has it's quirks. I haven't found a newbie proof and
newbie readable programming language yet.
[color=blue]
> A culture where a bunch of rude people who tell you to RTFM!!! every
> time you're confused about something?[/color]
That's the case in every technical NG, especially since most newbies
just ask FAQs and don't read the RTFM. Do you want to reward that
behaviour? If you can't RTFM you will have an extremely hard time to
even grasp the basics of whatever language you want to learn.
[color=blue][color=green]
>>Then learn not to point a gun at your foot. There is no language that
>>protect you and guides you to be an excellent programmer.[/color]
>
> We're talking about learning, if I were going to teach someone to aim
> a gun, it's very doubtful I'd start them out with a bazooka on
> horseback unless I wanted them to fail.[/color]
They want that bazooka :-D. There are two ways, you can give them a gun
and say: look it's way smaller than a bazooka, and hence, it can't harm
*bang*... student? student!??! Or you give them a bazooka with the
words: one wrong move can kill you, your loved ones or the horse. So put
it down and we first start to find out what this big ugly thing is.
[color=blue]
> Personally, I agree with your sentiment in many respects. The thing I
> don't like about PHP is that it's frankly boring. (Also don't like the
> whole $_POST/$_GET thing) would be nice if you could parse the data
> before PHP got to it.[/color]
GET -> QUERY_STRING. And I can't think of a reason why.
Got Scripting? wrote:
[color=blue]
> that being said, i would say that learning PHP will be more useful. a
> Perl alternative to CGI is to use mod_perl, but PHP is probably easier
> to learn,[/color]
And probably not. The fun thing: in an attempt to make PHP less uglier than
Perl they succeeded to do the opposite (one good say one of the biggest
successes of PHP).
[color=blue]
> and certainly more prevalent.[/color]
And way more bad code is available, and the PHP documentation looks like
it's reversed engineered from the code (which I hopefully never have to
see).
[color=blue]
> whether or not that prevalence
> is a good thing is another matter.[/color]
What IE did to the client side, PHP does to the server side.
Comment