The given example is bad - so bad it is almost shameful. In a literal sense, this is a call that evaluates only two different contexts: whether the area with square brackets is executed or skipped.
Here is a logical analysis to better explain what:
If the published source, if the estimate is false, the zero-coalescing operation is shorted and forces a true estimate of "== false". Then curly-bracket-content is executed.
If this rating is something else, then null-coalesces evaluating to "true" and forces a false rating of "== false". Then the contents of the italic bracket are skipped.
So, in fact, the correct and very simple way to write the original source:
if( Convert.ToBoolean( ViewState[tp.UniqueID + "_Display"] ) == false) { // do something }
In particular, it does not have a zero join operation.
The problem with this is that the example is not enough to even justify the use of the zero-coalescing operation, and this predicts the need to ever βconvertβ the operation to Visual Basic.
Hardryv Apr 23 '15 at 16:39 2015-04-23 16:39
source share