RE: Setting flags versus checking for existing/nonexisting values

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Brad Bonkoski <mailto:bbonkoski@xxxxxxxxxxxxxx>
    on Tuesday, August 15, 2006 10:04 AM said:

> Pros: potentially more readable code.
> Cons: Wasted energy typing unnecessary lines of code.
> Really I would say it comes down to coder preference.
> 
> (and why would you avoid the latter all together?  Testing a boolean
> may be cleaner, but setting the boolean still relies on the value of
> $value, so if that value was fubar then the boolean would be too.)

Thanks for the response. Those are basically the same assumptions I had.
I was curious to find out if there were more points I should be aware
of.

To answer your question, in case the cons outweigh the pros. If I felt
an overwhelming majority of the people on the list said, "In my
experience you should always set flags because you'll run into a, b, c,
d, e, f, g, etc." I would probably agree to avoid the latter practice
altogether.


Chris.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux