4 ms·
You're misinformed about Perl's philosophy. "There is more than one way to do it" doesn't mean they're all good, and all well respected by the community. There
by phaylon 16y ago
You're misinformed about Perl's philosophy. "There is more than one way to do it" doesn't mean they're all good, and all well respected by the community. There is always more than one way to do it and I have yet to see a single production-grade programming language where that isn't the case. If it were as you said, there wouldn't be a Modern Perl movement, there wouldn't be tons of syntax extensions, and extensions to the core to allow better and more powerful syntax extensions.
- Cushman 16y agoI didn't intend any slight against Perl (nor an endorsement of Ruby, for that matter), and I know I shouldn't speak on a language I don't know so well. I've always understood the general trend in Perl to be towards economy rather than expressiveness, but I'm totally willing to admit that may no longer be the case.
- phaylon 16y agoI'm sorry if I misinterpreted your statement. I just wanted to clarify that "the most unreadable solution is the most elegant" is not Perl's philosophy by far :) More the opposite. Most of the times you see Perl hackers celebrate some kind of complex syntax expression, it's mostly not the syntax they're enjoying, but the expressed principle. You could still hide it behind a DSL, which most of the time makes sense anyway in production code; DRY and all that. But that would also hide the principles and implementation that was used. So, in generally the Perl community will communicate ideas and concepts via short Perl snippets, and Perl's freedom of syntax makes that easily possible even on Twitter or IRC. In Perl, expressiveness was always very important. It was just done by the use of symbols and syntax instead of words. It's always a trade-off between being able to read an algorithm without knowing the language, and being able to express your ideas concisely. Personally, I have more troubles with sigil-less variables than with any implementation that uses any kind of symbol to identify them. Others find them distracting. It's a personal choice. If you have complex nested expressions in Python that do lots of things, you should put it in a function and call it by name. It's the same thing in Perl.
- Cushman 16y agoNo, "Perl's inverse" was unnecessary snark and you're right to call me out on it. Thanks for the explanation :)