|go ahead... be a heretic|
Special cases make special communityby kyle (Abbot)
|on Feb 01, 2009 at 06:36 UTC||Need Help??|
Perl has a lot of features that are not immediately obvious to the casual observer. By "casual observer," I mean someone who sees the language "in the wild" but hasn't formally learned it. Think of the programmer who learns it by opening up some working Perl and modifying it.
Consider, as an example, split. Here's a typical invocation:
To the casual observer, there are three things that go with split: a record, a field separator, and someplace to put the separated fields. One could see a lot of Perl without ever seeing any variation on this usage.
Nevertheless, there are a lot of possible variations.
Those are just the ones I know off the top of my head. A look at the split documentation shows other interesting special cases that I'm pretty sure I've never run into. I know at least some of the features I've listed above were present in Perl 4, and yet they still feel to me like afterthoughts.
(A better example of an "afterthought feature" might be the (?xxx) style features in modern regular expressions. Why do they always start with an open parenthesis and a question mark? I've always assumed it's because that would have been a syntax error in earlier versions of Perl. No earlier code could have been relying on (?xxx) to do anything meaningful, so it's safe to have later code use it for features the earlier Perl didn't have. Now we have lots of different things introduced by an open parenthesis and a question mark.)
I like these extra features. It's fun, like discovering a pocket you didn't know you had in a garment you've worn for years. Still, I wonder sometimes if Perl's casual observers are put off by these things. My guess is that it depends on one's attitude. Some are (as I am) delighted by discovering something new in something old. Others may be dismayed that they did not know the language as well as they thought and may even despair that they'll never master it as they'd like.
I think this is why the Perl community is so important. The monks welcome newcomers and guide them through the language. Experts can show the inexperienced what's in the dark corners and tell them when and why to go there. There are pitfalls, but at the Monastery, there's usually someone hanging around to direct the unwary away from them. In these and other efforts, the monks demonstrate an attitude that delights in discovery so that those without that attitude may witness it, learn of it, and perhaps take it as their own.