4 ms·
Perl is joy to write (especially with Modern::Perl qw(2016) and feature qw(signatures)) but is hard to read. I can write lot of code in single line with map/red
by v_lisivka 9y ago
Perl is joy to write (especially with Modern::Perl qw(2016) and feature qw(signatures)) but is hard to read. I can write lot of code in single line with map/reduce/split/join/regexps, but without chaining of operators it is mess, because order of operators is opposite to order of execution. It because of traditional function or operator invocation syntax: "x(a1, y(a2, z(a3, a4), a5), a6)", instead of modern chain of calls: "z(a3,a4).y(a2, a5).x(a1, a6)" . The more operators I pack into single line of code with traditional syntax, the harder it to read.
Perl6 has "feed operator", but it is not ported to perl5 to date. Perl6 syntax is clean:
my @array = <7 8 9 0 1 2 4 3 5 6 7 8 9>;
@array ==> unique()
==> sort()
==> reverse()
==> my @final-array;
say @final-array;
but perl6 is slow, so it is not gaining any popularity.
- singingfish 9y agoperl can be hard to read. but then again it can be easy e.g. https://gist.github.com/anonymous/a229b77c8ab25026633f1ab819c29a78 https://gist.github.com/anonymous/a229b77c8ab25026633f1ab819...
- v_lisivka 9y agoI can write readable page of code. I want to write readable line of code.
- lizmat 9y agoNot sure when you last tried to run your Perl 6 program, but things have improved over the years. Today Rakudo Perl 6 celebrated having one of the most tested canary programs break the 100x faster barrier: https://twitter.com/zoffix/status/957322578460315649 https://twitter.com/zoffix/status/957322578460315649