我见过这样的代码:
if(statement) do this; else do this;
我不喜欢这样,我认为这更清洁,更具可读性
if(statement){ do this; }else{ do this; }
这只是一个偏好问题,还是会推荐一种方式?
if-statement coding-style curly-braces
coding-style ×1
curly-braces ×1
if-statement ×1