MLUG: Re: [MLUG] Quick programming question on style
Re: [MLUG] Quick programming question on style
Email address obfuscation in effect -- please click here to turn it off.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
On Fri, 3 Jun 2005, Jeremy Hinegardner wrote:

> This looks to me as if someone was planning on putting some
> success/fail/debug code in but just never did it. 

Always, always, check your return values.

> Personally I use the first style, but switch it to:
> 
>     if (1 == testcase) {
> 
> That way if you make the common mistake of using a '=' instead of an
> '==' you'll get a compiler error.  I have no idea where I first liearned
> this but I tend to use it in any langugae.  Putting the constant on the
> left side of the comparison prevents accidentally assigning a value to
> the variable.

Ooo.  Now that's a handy tip.  Not that I've seen it used much.


--dlloyd
_______________________________________________
members mailing list
EMAIL:PROTECTED
http://mlug.missouri.edu/mailman/listinfo/members