develooper Front page | perl.bootstrap | Postings from July 2000

Re: Complex Problems vs. Simple Tools

From:
abigail
Date:
July 24, 2000 19:26
Subject:
Re: Complex Problems vs. Simple Tools
Message ID:
20000725022501.5189.qmail@foad.org
On Mon, Jul 24, 2000 at 07:08:23PM -0700, Peter Scott wrote:
> At 07:53 PM 7/24/00 -0600, Tom Christiansen wrote:
> > >By way of further inflammatory suggestions, I would like the (less)
> > >strictness levels to be install-time options, so that sites can make
> > >policies for their developers that prohibit some or all strictness being
> > >turned off in their perl.
> >
> >So again we're back to understanding how will scripts developed at
> >one site run properly at another one where the environment is so
> >radically different.
> 
> I don't think this is the same, nor a problem in this case.  If someone 
> sends me a script and when I run it, it produces:
> 
> "no strict 'cruft'" prohibited by site policy at blarch line 3
> 
>          The program you are attempting to run tried to disable one
>          or more levels of strictness (presumably out of some false
>          sense of laziness, who knows), but your site administrator
>          has specifically prohibited this type of corner-cutting
>          (presumably out of some desire for consistency, who knows).
> 
> then I know exactly why it doesn't run, and that I can either blame the 
> author for writing to a loose standard, or my sysadmin for requiring a 
> tight one.  Either way, it allows sites that want to enforce certain coding 
> standards to do so, and I think many would.  Would *I* want to use a perl 
> that had been restricted in that way?  That's not the point.

I'm sorry, but that doesn't enforce any coding standard. After all, your
example begins with "someone sends me a script". It wasn't coded there.
And if you want any coding standards, no level of strictness is going to
give you that anyway. The minimum coding standards will have is 'sensible
variable name, useful comments, appropriate subroutines'. And then you
aren't going to get with strictness anyway. Don't deceive yourself into
thinking you get someone you can't get.

Coding standards are good. But everyone has their own ideas on what good
coding practise is. Too often, in various channels (IRC, p5p, Usenet),
you see someone argueing to deprecate or remove a certain construct,
for no more reason that "it's bad coding practise". But it's only bad
coding practise in their minds - or worse, they chant a dogma. (A typical
example is "goto", where people mindlessly repeat Dijkst^WHoares title
"Goto considered harmful". However, goto can be useful in certain cases,
as Knuth has shown us, but his paper is less known (although most people
haven't read Dijkstra's paper at all).)

I do not think it's Perls task to force coding standards, or even any form
of strictness by default. 



Abigail



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