Hi there,
I am modifying an asp.net site and I stumbled upon this line of code.
Does that work? As far as I can tell it would be OK but I would have never written that... maybe it's not as wacky as I am thinking it is. In my world I would have first checked for the existence of the query string variable then stopped if it didn't exist (or whatever I needed to do)... Then I would have probably had a this.Code://aggregate is bool - which could have been named "canAggregate" if (aggregate && Request.QueryString["Aggregate"] != String.Empty && Request.QueryString["Aggregate"] == "1")
I know that precedence makes the extra parenthesis unnecessary but for readability I probably would have put them in.Code:if (aggregate && (Request.QueryString["Aggregate"] == "1"))
What does the community think about it? Is it good form? What would you do? I realize that there may be many answers to this question but I just thought I would get some feedback from the people...
Thanks




Reply With Quote