|Just another Perl shrine|
Coding styles using if/elseby sulfericacid (Deacon)
|on Apr 05, 2007 at 22:20 UTC||Need Help??|
sulfericacid has asked for the
wisdom of the Perl Monks concerning the following question:
While coding something today I came across an interesting question regarding coding styles. Say you have a test you need done in which, when successful/unsuccessful, you exit the script completely AND after that test is done, you do something else.
Easier asked with an example, I s'pose.
How many of you exclude the else clause in the above situation?
Can anyone think of a reason why the first example could be a bad idea under given circumstances? I can't see how either would be better or worse, but am curious to see how you guys would perform simple tests like this.
"Age is nothing more than an inaccurate number bestowed upon us at birth as just another means for others to judge and classify us"