perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <s...@stason.org>
Subject Re: svn commit: r372010 - /perl/modperl/trunk/src/modules/perl/modperl_cmd.c
Date Thu, 26 Jan 2006 05:00:13 GMT
Philippe M. Chiasson wrote:
[...]
> Yes! That's also another _very_ good reason to type comparaisons with the constant
> on the left side. I always try to write it in that order, and by now, my brain
> is fully adjusted to it.
> 
> if    ("Inherit" eq $var) {
> elsif ("Enable" eq $var) {
> elsif ("Disable" eq $var) {
> 
> Also puts the things being looked for first, making the statement somewhat clearer
> to me.

I suppose when all you use is a hammer, everything looks like a nail :)

What if sometimes it's $var and at other times $bar? e.g. what reads better:

if    ("FooBar" eq $var) {
elsif ("444" eq $bar) {
elsif ("foobartar" eq $bar) {

or:

if    ($var eq "FooBar") {
elsif ($bar eq "444") {
elsif ($bar eq "foobartar") {

the second version is much more parsable if you ask me.

I admit my variables nicely align, which makes it easier to read :)

-- 
_____________________________________________________________
Stas Bekman mailto:stas@stason.org  http://stason.org/
MailChannels: Assured Messaging(TM) http://mailchannels.com/
The "Practical mod_perl" book       http://modperlbook.org/
http://perl.apache.org/ http://perl.org/ http://logilune.com/


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Mime
View raw message