[jifty-devel] Questions on style, janitorial practice

Edgar Whipple jifty at misterwhipple.com
Sat Mar 3 14:53:07 EST 2007


I've snipped out the unequivocal No's and Yes's, but I will remember to
take account of them when I update.

On Sat, 2007-03-03 at 18:08 +0000, Jesse Vincent wrote:
> First up, even if I've got a different take on good style than you do,
> I really do appreciate the work you're doing to clarify and codify.
Thanks for the thanks, and back at you. I'm really glad to find a
project where I can participate usefully.

> PBP is a great resource for folks newer to perl programming, but
> having been at this for..yikes, over a decade, I've definitely
> developed some style preferences that aren't the same as Damian's.
> (Though he does use vim, so he can't be that misguided ;)

OK. How about if I tweak that section in Style.pod to make it more plain
that PBP is a useful reference, but not followed strictly on every
point? Then I'll include the examples from this thread as, um, examples.



> > 4. Would it be useful to designate some level of perlcritic
> > compliance
> > as a goal?

> I don't believe so. Automated tools will give you kwalitee and not
> quality.  I'm perfectly happy for developers to use Perl::Critic when
> doing their own development, but tying Jifty to it isn't ok.
Noted. As with PBP, how 'bout I state this explicitly in the pod?

> > 
> > 5. /xms flags for regexes: Since these aren't semantically neutral,
> > I
> > wouldn't change them in someone else's code without prior
> > consultation.
> > However, is there a consensus on including them in Style.pod?
> 
> 
> Mandating them isn't the right thing. Gently hinting that they might
> be the right thing is great.
Got it.
> > 
> > 
> > 7. The following changes are semantically neutral, and make code
> > more
> > readable for some coders, especially the less experienced ones. Are
> > there any objections if I undertake these in janitorial?
> > 
> > 
> > -- changing all other regex delimiters to /.../ or m{...}
> 
> 
> Often there's a reason for the choice. It may not always be obvious.
> 
I should have been more precise: Changing other delimiters to the either
of the standard ones when I realize I had to stare for a moment before I
could pick them out. (In past experience, those have almost always been
better changed to m{} rather than //, so I should have been more clear
there as well.)

Short new form: Is it OK if as part of janitorial I change regex
delimiters to the m{} syntax when I find the original hard to read?
> 
> 
> > -- changing /.../  to m{...}, s/../../ to s{..}{..}, etc. for hairy
> >    expressions (or even stubbly ones)
Oops, duplicate of previous request. See above.
> 
> 
> Got examples of where you want this?
Not so far; I was reminded of it by the [?] and grep {} items that I did
encounter. 

The policy question isn't so much "Should all regexes be this way" as
"is it OK if I change them when it seems to be more readable?" If I have
to ponder the regex for a while before I understand it, I figure that
would be a candidate for (always semantically neutral) prettifying, for
the sake of the next guy.


> > -- $$foo to ${$foo}
> 
> 
> I'm ambivalent. Other folks have feelings?
Again, this is more "mother may I" than "everyone should". I figure
changing $$foo to ${$foo} won't make it less plain for the experts, and
will make it more plain for the novices, so I'd like to change them when
I run into them.
> 

> I can't find a single instance of "unless !" or "unless not" in
> Jifty's source. (This pleases and surprises me). Is there a place you
> found it?
Not so far. I'm just looking to see if anyone objects to my fixing it if
I encounter any.

Edgar
-- 
ln -s /dev/null ~/.sig



More information about the jifty-devel mailing list