On 4/15/10 11:30 AM, Jari Aalto via RT wrote:
Show quoted text> The following the advice of:
>
> ValuesAndExpressions::ProhibitEmptyQuotes
>
> would produce code that would be unlike in all other languages.
So?
Show quoted text> The ping-pong with changing quotes ( q() vs qq() ) don't work in real.
I don't follow.
Show quoted text> The XPers said it: less is more.
They're talking about less code, not what sort of quotes you use.
Show quoted text> Picking one set of quotes keep
> everything nicely under control.
>
> my $debug = "DEBUG:";
>
> Later:
>
> my $debug = "DEBUG $LIBRARY:" # No need for quote ping-pong
>
> Oh, the Conway's style probably suggests:
>
> my $debug = 'DEBUG ' . $LIBRARY;
No, it doesn't. He says only to use interpolating expressions if you are actually interpolating.
Show quoted text> Right. And let's apply that style convention here:
>
> my $debug = "$DEBUG:$LIBRARY ($LEVEL)";
>
> Is this the path to the wisdom? Let's see:
>
> my $debug = $DEBUG . ':' . $LIBRARY . ' (' . $LEVEL . ')'; # Ouch
Specious argument.
The way I use quotes indicates /intent/. If you see double quotes in my code, it means I expect there to be interpolation involved. Otherwise, I expect that there won't be. If I'm scanning through some code and I see something in single quotes or within q<>, I know that I don't have to examine it any further to tell whether there's any interpolation happening.
Show quoted text> It would be helpful to broaden the description strings.
The problem is that the output would rapidly scroll off of the top of the screen. You can set the verboseness to include the full description of the policy using "%d".