Is it necessary to write else part in every if condition?
问题 The question I asked might be closed, But i just want to know that is it necessary to write else part of every if condition. One of my senior programmer said me that "you should write else part in every if condition" . Suppose we have no condition for write in else part then what should we do ? I assume a healthy discussion will going on here.... 回答1: That's a horrible idea. You end up with code of the form: if (something) { doSomething(); } else { } How anyone could think that's more