perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <>
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) {


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
MailChannels: Assured Messaging(TM)
The "Practical mod_perl" book

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message