Not, is a operator, but not is a function

Just starting out? Need help? Post your questions and find answers here.
u9
User
User
Posts: 55
Joined: Tue May 09, 2006 8:43 pm
Location: Faroe Islands
Contact:

Post by u9 »

These are all very interesting solutions, especially this last one. SP I will recommend you use what ever is the most readable. All these fancy tricks are nice but are all no-no's in coding practices. Things such as a=1-a are not easy for others (or even yourself 6 months later) to see what a=1-a actually is intended to do (invert a boolean value). I recommend doing whatever is most straight forward to read or write some good comments for yourself about what the semantics of the particular line is.
The most likely way for the world to be destroyed, most experts agree, is by accident. That's where we come in; we're computer professionals. We cause accidents. (Nathaniel Borenstein)
http://www.wirednerd.com
Post Reply