[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Programming first steps.



Steve Lamb dijo [Mon, Nov 17, 2003 at 05:40:18PM -0800]:
>     Python's diametrically opposed philosophy is much better.  There should 
> ideally be only one obvious way to do something.  With that in mind the 
> language itself is much smaller.  Concepts are tied to one, maybe two 
> syntax. So in learning both at once, especially by reading examples, it is 
>  much easier.

...I don't know, there are points both for and against it - but I
think I must concede there is some truth in your reasoning.

>     Finally there is the simple fact that Python is interactive.  There 
>     have been many cases where I have a window on the left with my code and a 
> window on the right sitting in Python where I hash out my ideas because I'm 
> not quite sure how things are going to flow yet or exactly how the syntax 
> works.  I can play with the syntax, keep my data fairly static, work out 
> each step in detail and as I do put that in the script on the left.  IE, 
> nothing quite compares to learning how slices work across all kinds of 
> sequences other thank just playing with them like this:

Yup, that is something I always found lacking in Perl. In fact, I run
this very often:

--------------
#!/usr/bin/perl
my $count = 0;

print '-> ';
while (my $lin = <STDIN>) {
    my @r = eval $lin;
    print "R: @r\n" if @r;
    print "E: $@\n" if $@;
    print '-> ';
    undef $@;    
    $count++;
}

END {
    print "Leaving Perl Interpreter.\n",
    "$count statements executed.\nHave fun out there!\n";
}
--------------

Greetings,

-- 
Gunnar Wolf - gwolf@gwolf.cx - (+52-55)5630-9700 ext. 1366
PGP key 1024D/8BB527AF 2001-10-23
Fingerprint: 0C79 D2D1 2C4E 9CE4 5973  F800 D80E F35A 8BB5 27AF

Attachment: signature.asc
Description: Digital signature


Reply to: