Hello,
Is it a better practice to set flags to determine the action of your
code or is it perfectly acceptable to have your code determine what it
should do based on the existence (or lack thereof) of data?
For example:
?php
if($value == 1)
{
$flag = true;
}
if($flag === true)
{
Chris W. Parker wrote:
Hello,
Is it a better practice to set flags to determine the action of your
code or is it perfectly acceptable to have your code determine what it
should do based on the existence (or lack thereof) of data?
For example:
?php
if($value == 1)
{
$flag = true;
}
Brad Bonkoski mailto:[EMAIL PROTECTED]
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
On Tue, 2006-08-15 at 10:12 -0700, Chris W. Parker wrote:
Brad Bonkoski mailto:[EMAIL PROTECTED]
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
On Tue, August 15, 2006 11:53 am, Chris W. Parker wrote:
Is it a better practice to set flags to determine the action of your
code or is it perfectly acceptable to have your code determine what it
should do based on the existence (or lack thereof) of data?
For example:
?php
if($value ==
On Tue, August 15, 2006 11:53 am, Chris W. Parker wrote:
Is it a better practice to set flags to determine the action of your
code or is it perfectly acceptable to have your code determine what it
should do based on the existence (or lack thereof) of data?
For example:
-snip- flag example
6 matches
Mail list logo