[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: pragmas



Bob Cassels <bobcassels@netscape.net> writes:

> mvanier@cs.caltech.edu wrote:
>
>>Good to know ;-)
>>
>>I think much of the prejudice against perl has to do with people (like me)
>>who only used it way back when there weren't a lot of the current options.
>>
>>Perl seems to win the prize as the language with the most pragmas, by which
>>I mean language-altering special statements (maybe there is a better word
>>for this).  You got yer "use strict", "use warnings", etc. etc.
>>How do people feel about this feature in general?
>>
>
> To me, semantics-altering pragmas feel like a good way to make code
> harder to read.  (And I prefer readability.)  People complain about
> macros making code harder to read.  At least with macros, you can see
> that there's something you have to look for and understand, so you
> know you have to work a little harder to understand new code.  But
> with pragmas, you need to know they're present, and figure out whether
> they matter for any piece of code you're looking at.  Or else you risk
> misunderstanding the code.

Which is why such pragmata are lexically scoped (now) in Perl. Anyone
who wishes to point at some delightful global variables as $[ (Don't
like arrays starting at zero? Just do '$[ = 11' and look, they start
at 11 now. Once upon a time changing this changed the array base
*everywhere*, but it's not been like that for long time, and the only
reason anything remotely like it is still there is because there are
still fossil scripts out there that were built on top of a2p generated
scripts.) which is a fossil and the sooner it goes away the happier
we'll all be...

-- 
Piers