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

Re: pragmas

Scott McKay <swm@itasoftware.com> writes:

> At 1:10 PM -0700 5/23/03, Michael Vanier 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?  I personally
>>like the idea of pragmas if there is no other way to get the same
>>flexibility, although I would probably have set the defaults differently
>>than perl's are set ;-)
> I don't like directives that alter the semantics of
> the thing being compiled.  It's hidden global state
> that makes it harder to understand the program.  You
> can't just look at part of the program to ascertain
> that something somewhere else changed the rules.

Well, Perl's pragmata are generally lexically scoped, so the thing
that affects any compilation rules is usually in sight. 

But this is the macro argument all over again isn't it? Anything which
is compiled can affect the semantics of the code being compiled in
unpredictable ways; even in a macro free pure functional language you
can still go off and redefine something fundamental sowing confusion
along the way.

But generally, we don't. Personally, I want enough rope to really
screw things up bigtime, because that usually means I've also got
enough rope to do some really useful stuff.