C<strict> as default (was Re: RFC 16 (v1))
[email protected] (Daniel Chetlin) Fri, 4 Aug 2000 12:45:35 -0700
| Newsgroups | perl.perl6.language.strict |
|---|---|
| Message-ID | <[email protected]> |
[There will be lots of snippage here, so I can address the key issues without making this a 300-line megillah. I've tried not to take out too much context, and I'm certainly not intending to misrepresent, but I apologize if I've made that mistake.] J. David Blackstone wrote: > Daniel Chetlin <[email protected]> wrote: > > In large projects which require the constraining pragmas, it is not an > > issue to take the extra steps and 'use' them. > > How many of those large projects have you participated in? How many > people do you work with that you have to constantly cajole and prod to > "use strict;"? It is indeed an issue, in several ways. Peter Scott wrote: > This is a (not *the*) key to the acceptance of Perl for large projects in > large institutions. You don't have to work for one or like the way they go > about things, but if we can give them something that doesn't hurt everyone > else then it's a win. At least by the "Big House" philosophy. And in a different message, Peter Scott also wrote: > This is a (not *the*) key to the acceptance of Perl for large projects in > large institutions. You don't have to work for one or like the way they go > about things, but if we can give them something that doesn't hurt everyone > else then it's a win. At least by the "Big House" philosophy. I don't want to turn this into a muscle-flexing "well-I've-done-such-and-such" credibility contest, but I think it's important for me (as maintainer of RFC 16) to make it clear that I do more than just write one-liners and make quick-and-dirty hacks with Perl. I just finished up a contract (right before TPC) with Intel, where I worked on a project that was put into production as 80,000 lines of code, 95% in Perl. And of course, C<strict> was ubiquitous for this project. In fact, it was initially a cleanup of old Perl 4 and early Perl 5 code, and making the scripts compile under C<strict> was one of our first milestones. So I am familiar with both large projects and large institutions. I am not in the least bit interested in making C<strict> go away; in fact, I'd love to see it expanded, changed, and made more useful. I use it all the time. I just think it's the wrong idea to put it on by default. J. David again: > If your scripts are one-liners that involve the -e switch and we go with > "strict 'vars' in all cases except -e," then you have no need to worry; > the proposed changes will not affect you. This seems wrong to me: do we want a one-liner to perform differently if it's pasted into a file? > We'll keep hashing this out to try to satisfy everyone, so keep talking. Absolutely; I'm by no means unconvincable on this subject. I appreciate the calm ways it's been discussed so far. I know that this is something of a philosophical issue, and can easily turn nasty, and I guess as J. David's opposing co-chair of this subgroup, I should make it clear up front that I appreciate everyone's sanity to this point. > > This RFC is particularly concerned with the idea of having C<strict > > 'vars'> on by default. This is an attempt to get around Perl's design of > > having all variables global by default, and lexical only when declared. > > Some would say that Perl wasn't exactly designed aroung all global > variables; it was more of an accident. In fact, the Camel book 2 all but > says so. Yep, I agree. I had a short conversation with MJD about this, and he made some great points. I don't want to paste it here without his permission, but I'm hoping he's listening. Although I do know he's going to Las Vegas, so he may not have time to chime in. But I agree that this was an accident and a mistake. And like I say later in the RFC, I feel that trying to fix this mistake by making C<strict> the default is like <insert clever analogy about fixing one problem with an unrelated solution>. I have more to say, but I'm sure I'll have plenty of time; I'm hoping to hear from lots of others about this as well. If it turns out that most people would prefer C<strict> by default, I will feel no shame in folding my RFC. I'm just banking on the fact that a fair amount of people share my lax-by-default philosophy about Perl. -dlc