in reply to Burned by precedence rules
I like to write the dumbest and most readable code that will the job done, and only expand from there when there is a real need for it in the design.
sub done { my $self = shift; if ( $self->foo or $self->bar ) { return 0; } return 1; }
I've had many issues bite me in the tail, but precedence is rarely one of them. Then again, I have such a huge itch about readability that I had to fight off the urge to define TRUE and FALSE constants for this tiny slice of code. So take these thoughts with however many grains of salt you desire.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Burned by precedence rules
by gwadej (Chaplain) on Dec 26, 2008 at 17:37 UTC | |
by tye (Sage) on Dec 27, 2008 at 17:50 UTC | |
by demerphq (Chancellor) on Dec 30, 2008 at 19:50 UTC | |
by ikegami (Patriarch) on Dec 30, 2008 at 20:09 UTC | |
by TimToady (Parson) on Dec 30, 2008 at 20:49 UTC | |
| |
by demerphq (Chancellor) on Dec 31, 2008 at 00:01 UTC | |
by gwadej (Chaplain) on Dec 28, 2008 at 20:46 UTC | |
by tye (Sage) on Dec 28, 2008 at 21:06 UTC | |
by gwadej (Chaplain) on Dec 28, 2008 at 21:22 UTC | |
| |
by webfiend (Vicar) on Dec 26, 2008 at 18:06 UTC |