[我经常看到专业程序员,在我通常会插入的地方省略括号,例如:
if(i==1)
printf("Hello World!"); // the if-body is not enclosed by curly-brackets.
或
x = 4 * 6 + 7 * 2; // I would brace (4 * 6) and (7 * 2), not (6 + 7) which would lead
// to a different result.
[我的学习书和老师告诉我,总是在应使用的地方加上方括号(即使仅用于[if]表达式,例如if(i==1){printf("Hello World!");}
)。
标准对如何正确编程或什么是好的编程风格没有太多要求。
但是如果专业程序员在有效的地方忽略了他们,那我为什么要这么做呢?
因为我不会浪费时间阅读否则。