3 ms·
"Using so many symbols to convey meaning as well." Actually as a visually oriented person I find it very helpful. And logical: $ - a single thing @ - a lis
by vgy7ujm 10y ago
"Using so many symbols to convey meaning as well."
Actually as a visually oriented person I find it very helpful. And logical:
$ - a single thing
@ - a list of things
% - a hash (associative array, key-value pair list)
\ - a reference to any of the above
my @fruits = qw/Apple Pear/;
my $company = $fruits[0];
# A reference can be declared directly, this is a \%
# with a nested \@. Encodes nicely to JSON as an example.
my $hash_ref = {
fruits => [
'Apple',
'Pear'
]
};
my $apple = $hash_ref->{fruits}[0];
"By design, Perl is harder to read if you write it the way it's intended to be used."
What way is it intended to be used? Perl 4 style mixing Perl and shell script?
Perl 5 has had (roughly) yearly releases since 1994 and is now at 5.24. Quite a bit has changed in that time and the language has evolved and improved.
There are modern non blocking web frameworks, great database support, several modern OO systems etc.
And Perl still works great shell script style (you can choose to code in a clean style) and for the most parts there is great backwards compatibility.
Perl is definitively about getting the job done. Hence the slogans "make easy things easy and hard things possible" and "there is more than one way to do it".
For someone well versed in Perl something like idiomatic Python becomes a prison where it is hard to get the job done because you can't freely express yourself.
I think it's not just philosophy or language design but people are wired differently. And Perl is a lot of fun for creative individuals.
Lastly, I am looking forward to the next years when the Python community has to clean up because of its current popularity with novice programmers. That's what Perl has been through and that old novice code is also where most of the undeserved reputation come from.