Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Learning Perl as a First (programming) language

by Abigail-II (Bishop)
on Aug 02, 2002 at 14:10 UTC ( #187093=note: print w/ replies, xml ) Need Help??


in reply to Re: Re: Learning Perl as a First (programming) language
in thread Learning Perl as a First (programming) language

Well, you are forgetting a my $i if you want to have equivalent code. I maintain the code is nearly identical - there's a few lines more in C, which look a lot for such a short program, but it wasn't linear in the size of the Perl program. Had you have had 100 of such loops, you'd have had the same amount of extra lines.

I never claimed that C would have been a better choice than Perl. Instead, I said that I didn't consider C a good first language either. IMO there's only one reason to learn C before learning Perl and that's because there's so much of C in Perl. It makes you a better Perl programmer.

Abigail


Comment on Re: Learning Perl as a First (programming) language
Download Code
Replies are listed 'Best First'.
Re: Re: Learning Perl as a First (programming) language
by talexb (Canon) on Aug 02, 2002 at 17:46 UTC
      Well, you are forgetting a my $i if you want to have equivalent code.
    No, :) I purposefully left it out, in order to demonstrate the point that Perl will autovivify a variable for you, while C will just throw an error. I also purposefully did not use strict or include the she-bang line.

    --t. alex

    "Mud, mud, glorious mud. Nothing quite like it for cooling the blood!"
    --Michael Flanders and Donald Swann

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://187093]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (8)
As of 2015-07-29 04:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (260 votes), past polls