in reply to Re: Learning Perl as a First (programming) language
in thread Learning Perl as a First (programming) language
The equivalent in Perl is#include <stdio.h> int main(void) { int i; for ( i = 0; i < 10; i++ ) { printf ( "%d", i ); } }
No variable declarations, a friendlier print statement, and no mysterious 'cargo-cult' include thingy.for ( $i = 0; $i < 10; $i++ ) { print $i; }
Don't get me wrong -- I have programmed in C since the early 80's and I love the language. But Perl takes care of lots of the underlying stuff (how many times did I write fopen(), fread() and fclose() statements I wonder). That's why I think Perl is a better choice than C.
Perl can be a heavyweight language, but it can also be lightweight. To use the car analogy, C is a bit like the British Triumph, a little finicky, but piles of power and cornering. Pascal is a bit like a Pinto or a CV5 stuck in second gear. Perl is like a Porsche or a Lexus, nimble yet powerful.
--t. alex
"Mud, mud, glorious mud. Nothing quite like it for cooling the blood!"
--Michael Flanders and Donald Swann
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Learning Perl as a First (programming) language
by Abigail-II (Bishop) on Aug 02, 2002 at 14:10 UTC | |
by talexb (Chancellor) on Aug 02, 2002 at 17:46 UTC | |
Re: Re: Re: Learning Perl as a First (programming) language
by sauoq (Abbot) on Aug 02, 2002 at 19:31 UTC |