Sunday, July 26, 2009

In C# Programming can you combine as many AND and OR operators in a Boolean expression as you need?

yep. i have yet to experience a limit. of course i can't think of an expression that i wrote using more than maybe 4 or 5.





if you find yourself going over that, you may want to nest your expressions to make it more readable. if not, you better be commenting the crap out of it. i'd hate to be the programmer to come in behind you and try to figure out the reasoning behind an expression with 20 %26amp;%26amp;'s and 7 ||'s.

In C# Programming can you combine as many AND and OR operators in a Boolean expression as you need?
Yes you can have as many as you need.
Reply:YES as long as its logical, but best opractice would be to try to seperate that...





makes it hard to see the logic if it's all bunched in together like that...


No comments:

Post a Comment