develooper Front page | perl.perl5.porters | Postings from December 2007

5.11 (or 12) and strict

Thread Next
From:
Steffen Mueller
Date:
December 26, 2007 07:12
Subject:
5.11 (or 12) and strict
Message ID:
20071226140524.8648.qmail@lists.develooper.com
Hi p5p,

I'm sure this proposal will be shot down in a second and I'll be banned 
from posting to perl5-porters again*, but I'd never forgive myself for 
not trying:

Personally, I've always wanted perl to have strictures on by default for 
my code. I would think that 95% of all code bases which were written in 
this century and which are of non-negligible size import "strict". I 
don't use strictures for one-liners, of course, but for anything else 
it's a must. It seems to me like others have similar views on this. Try 
posting some code without "use strict" to some newsgroup or forum and 
ask for help. Make sure not to give out your email address, though.

"use 5.10.0;" already auto-imports feature.pm and loads the 5.10 
specific features.

How about having "use 5.11.0;" (or 5.12.0) automatically import strict 
along with the 5.10+5.11 feature set? Naturally, the -E switch for 
one-liners should *not* do that.

This would *not* break backwards compatibility. This would not affect 
one-liners. This would optimize for the common case: If you write enough 
code to make importing optional features worthwhile, odds are very high 
you'd be importing "strict" anyway. The 5% who need to disable 
strictures again can still add a "no strict;" statement.

strictures-correct code has been best-practice for a long time now. 
Let's make it the default for *new* code.

Just think of strictures as a feature. It just makes sense.

Cheers,
Steffen

* I'm having a bad day already. Come on make it worse! ;)

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About