5 ms·
This is my own personal opinion, but I despise Perl. The language requires a ton of memorization of small, tedious rules that are arbitrary, and there are many
by pfarnsworth 10y ago
This is my own personal opinion, but I despise Perl. The language requires a ton of memorization of small, tedious rules that are arbitrary, and there are many disparate ways of writing the same thing. I remember giving up on Perl when I discovered that || and or were both "or" operators but had different precedences.
Again, this is my own personal opinion. I know many people have made some great software based on Perl, but it's the only language I won't touch with a 10 foot pole, and I've spent a couple of years programming in PHP and a year in COBOL.
- codesnik 10y agoperl's rules are very very consistent and logical. (especially compared to PHP, and much more logical than e.g. javascript) They don't always look nice when applied to contemporary problems, but for me it grew in the language feeling, when I could understand what perl does in particular case without looking into it's documentation. But ruby was a quite a happy move for me back then in 2006, language was underperforming, features were lacking, nowhere anything like CPAN, but I could express logic much closer to how I think about problems, without additional layer of "thought translation".
- Roboprog 10y agoThe real WTF, in any language, is relying on precedence, rather than just using parens. I've seen some expensive boo-boos due to operator precedence mistakes (e.g. - in C) That said, there are a lot of special variables that can be tedious to figure out (e.g. - $" vs $;), if somebody uses the less frequently used ones, rather than the long-form names.
- falsedan 10y agoman perlvar was always pretty easy to search & explained the real purpose of whatever goofy line noise people would use
- Roboprog 10y agoYep. That's where I found $" and the other one, whatever it was :-) I can remember $_, $? and $!, but that's about it. And I like Perl.
- b2gills 10y agoThe only ones like that which exist in Perl 6 are $_ @_ %_ $! $/ The rest were either just abandoned or given names such as $GROUP or $PROGRAM-NAME $/ isn't the same as it was in Perl 5 instead it is for storing the result of successful matches. ( you can also assign to it ) $0, $1, $2 is short for $/[0], $/[1], $/[2] $<abc> is short for $/{'abc'} which can be spelled as $/<abc>
- berntb 10y ago>> operator precedence mistakes (e.g. - in C) Many years ago, I had a bookmark in my C manual (Harbinson Steele) for the operator precedence page. After a while I removed that bookmark. I decided that if I needed to look at that list, I should use parentheses. :-)
- DonHopkins 10y agoI could just drop my K&R C manual down on the spine, and it would always open up to the operator precedence page. No bookmark was necessary because I always had to open it to that page so often.
- Roboprog 10y agoThat's an important page - for reading other people's misguided cleverness.
- llamataboot 10y ago>> I remember giving up on Perl when I discovered that || and or were both "or" operators but had different precedences. || has a higher precedence than or in Ruby as well.
- marshray 10y agoYeah that was one of my favorite features.
- DonHopkins 10y agoAm I totally misunderstanding you, or are actually saying "||" having higher precedence than "or" is one of your favorite features? Ruby features or Perl features? How does that tangibly effect your day to day life? What is your second favorite feature?
- saghm 10y agoAm I the only one who just completely ignores `and` and `or` in Ruby in favor of `&&` and `||`? The boolean keywords do look nicer than the operators, but given that there are some contexts where you can only use the operators, I just don't bother using the keywords at all
- lloeki 10y agoNo: > rubocop -D foo.rb Inspecting 1 file C Offenses: foo.rb:1:3: C: Style/AndOr: Use || instead of or. a or b ^^ 1 file inspected, 1 offense detected
- tech2 10y agoI was trying to help with an algorithm used in some of our Perl code recently, writing some tests I'd used \A and \Z in a regex. My Perl co-worker told me it should be \z, I asked why and he said: > who knows :| > It Just Is. > remember, perl is a memory competition There is a LOT to remember about how Perl works.
- berntb 10y agoUh..? 1. PCRE copies the Perl regex syntax almost completely (except some much newer cases than \A and \Z). See e.g. http://www.rexegg.com/regex-quickstart.html http://www.rexegg.com/regex-quickstart.html for \A, \Z, \z 2. If you check http://perldoc.perl.org/perlre.html http://perldoc.perl.org/perlre.html then: \a alarm (bell) \A Match only at beginning of string, as PCRE. \z \Z Same as PCRE. (But \z is not in Regexps for Python/JS.) Edit: You might want to note that the regexps are redone quite extensively in Perl 6 and to a large part replaced with grammar for those use cases.
- tech2 10y agoTo be fair it wasn't _just_ that particular thing, that's just the part I remember. There were other things that every time I have to go back to the docs for. It _is_ a memory competition though. In the various languages I've learned, Perl feels like it has the most to remember about how things work or interact (ymmv of course, I'm speaking of my experience here).
- berntb 10y agoI have to agree with that, it could maybe take an extra work week in the beginning, to get beyond baby language. (But it wasn't as bad as C++ was for me. :-) ) Expressive is the good side of this. But you really need to have coding standards in place. On this subject, to upgrade to Perl 6 will be a bit scary, like driving a much faster car. :-)
- tech2 10y agoThe problem there of course (migrating to Perl 6) is also finding matching packages for the _huge_ list we presently use. I can also only imagine the fallout from various issues like places we may have accidentally used the outcome of a dualvar accidentally, or other interesting side-effects of Perl 5. 6 Looks just fine as a language, but it really does feel like a completely new language which means it's less a migration and more a re-write. Which then leads to the question: if we're going to re-write, should it still be Perl?
- marcosdumay 10y ago> I remember giving up on Perl when I discovered that || and or were both "or" operators but had different precedences. This one is useful. Remember that Perl was created for being a more powerful kind of shell. Those operators have their precedence set so that you'll use || as a logical operation inside a command, and "or" for control flow between commands. The same is true for && and "and".