|
-
March 9th, 2004, 08:13 AM
#1
Conditions and use of if, elseif or ORed ifs
I want to know which of the following is better and why. Can you please let me know your thoughts? - Thanks
Set one
----------
if (varialbe == something)
{
//identical code
}
if (variable == somethingElse)
{
//identical code
}
Set two
----------
if (varialbe == something)
{
//identical code
}
elseif (varialbe == somethingElse)
{
//identical code
}
endif
Set 3
-------
if (varialbe == something || variable == somethingElse)
{
//identical code
}
// identical code - excatly same line of code in both the conditions
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|