3 ms·
It has taken me years to absorb perl's little idiosyncrasies and I've learned to like it. Then I read perl6 docs and I can no longer defend using perl. For exam
by snorkel 18y ago
It has taken me years to absorb perl's little idiosyncrasies and I've learned to like it. Then I read perl6 docs and I can no longer defend using perl. For example, here's the perl6 tertiary assignment:
my $foo = $bar < 1 ?? 0 !! 1;
Every other language on the planet including perl uses ?: for the tertiary but perl6 just had to be different for no good reason other than to be different. No. No, No, No thank you. Consistency matters. The most important feature in any programming language is clarity. Producing Pascal's Triangle using less than 5 characters of source code is not something programming language designers should be aspiring to. Python is looking better every day.
- chromatic 18y agoPerl 6 changed the syntax of the ternary conditional operator for other reasons: less ambiguity of syntax, for one. (If you're really curious about the reasoning, I believe Apocalypse 3 "Operators" explains.) The interesting question is whether Perl 6 can slough off syntactic baggage from C and Perl 5 for the purpose of clarity and attract more new programmers. I believe the changes from regular expressions to grammars demonstrate the viability of this concept.
- snorkel 18y agoI'm sorry but if every programming language out there uses ?: then that's not ambiguous at all.
- scott_s 18y agoPerhaps he meant the ambiguity of parsing?
- chromatic 18y agoIndeed, and not just for the compiler's parser. I don't believe that Algol-family syntax is the best representation for source code. Nor do I believe that of S-expressions. I believe it's possible to produce a consistent syntax that's understandable and maintainable (and linguistically justifiable) for a modestly skilled practitioner of the art. Internal consistency of Perl 6 is more important -- even to novices learning the language -- than consistency with other languages, even Perl 5. Many of the linguistic and syntactic quirks of Perl 5 came from other languages. Not all -- but many.
- draegtun 18y ago> Every other language on the planet including perl uses ?: for the tertiary... Including Python? ;-)