I always put an error message in my unneeded elses, even if it is "impossible"

They've helped me to catch bugs quite a few times.

-Phil

On Thursday 03 April 2003 10:28 am, Tony Esposito wrote:
> When you have an if-elsif-else situation like below, where there is no
> action taken on the final 'else', is there a way to just say 'continue' -
> like one would do in C - or is it considered 'ok' to just leave off the
> final 'else'?
> My experience has taught me to include the final 'else' but just add a
> 'continue' command or NULL.  This is to make the code more readable.
>
> Example:
>
>     if(! defined($ini_filename)) {
>        return(int 2);
>      }
>     elsif (! -e $ini_filename) {
>        return(int 4);
>     }
>     elsif (-z $ini_filename) {
>        return(int 5);
>     }
>     else {
>  #  do nothing and there's nothing to say so just continue
>     }
>
>       Thanks!
>
> > Anthony (Tony) Esposito
> > Senior Technical Consultant
> > Inovis(tm), formerly Harbinger and Extricity
> > 2425 N. Central Expressway, Suite 900
> > Richardson, TX  75080
> > (972) 643-3115
> > [EMAIL PROTECTED]

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to