Confusing If Statement?

前端 未结 13 882
-上瘾入骨i
-上瘾入骨i 2020-12-20 13:03

I always use If statement (In C#) as (1. Alternative);

if (IsSuccessed == true)
{
   //
}

I know that there is no need to write \"== true\"

13条回答
  •  [愿得一人]
    2020-12-20 13:18

    I prefer the second alternative. I think it's more readable, but the first alternative has the advantage of staying the same if you need to use Boolean? for some reason.

提交回复
热议问题