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 shoul
No, but I personally choose to always include encapsulating braces to avoid
if (someCondition) bar(); notbar(); //won't be run conditionally, though it looks like it might foo();
I'd write
if (someCondition){ bar(); notbar(); //will be run } foo();