Re: Perl vs Python vs Ruby
- From: Tim Hammerquist <tim@xxxxxxxxxxxxx>
- Date: Wed, 19 Oct 2005 17:29:29 GMT
Chris Barts <chbarts+usenet@xxxxxxxxx> wrote:
[ snip ]
> I agree fully, with the exception that @array -> $array[0] is
> somewhat irrational,
I think it makes perfect sense in the context of Perl. And Perl
is all about context. It's what makes it so powerful.
The [$@%] symbols indicate what type of data is being accessed,
not necessarily what type of variable it's accessed from.
> and that being able to use %foo, @foo,
> and $foo as unrelated variables in the same program is insane.
This is a valid point, but not one I personally feel strongly
about. This provides for the following confusion:
my %var = ( 0 => 'zero', 1 => 'one', 2 => 'two', 3 => 'three');
my @var = qw/zero one two three/;
print "@var[0..3]\n"; # array slice
print "@var{0..3}\n"; # hash slice
But most confusion like this can be avoided by using strict,
warnings, and descriptive variable names.
> Ruby is closely related to Smalltalk and Lisp. If you don't
> know either of those languages, and you should learn them,
> Ruby will indeed look foreign to you. (Personally, I think
> it's a very elegant language.)
$ruby++
Tim Hammerquist
.
- References:
- Perl vs Python vs Ruby
- From: it_says_BALLS_on_your forehead
- Re: Perl vs Python vs Ruby
- From: Chris Barts
- Perl vs Python vs Ruby
- Prev by Date: Re: File uploading from a local desktop to a web server..
- Next by Date: Re: How can I download all the FAQ in this usenet
- Previous by thread: Re: Perl vs Python vs Ruby
- Next by thread: where is my text file?
- Index(es):
Relevant Pages
|