基本所有公司的编程规范都有如下的规定
Spaces vs. Tabs
Use only spaces, and indent 2 spaces at a time.
We use spaces for indentation. Do not use tabs in your code. You should set your editor to emit spaces when you hit the tab key.
只使用空格,每次缩进2个空格。
使用空格进行缩进,不要在代码中使用tabs,设定编辑器将tab转为空格。
为什么不用tab
最近看到有朋友提交了这样的代码:
在缩进出现了较大问题,这是由于在Merge中tab被当作8个空格。虽然在编写者自己的编辑工具上看,缩进是很统一的,但是放到其他编辑器就出了问题。
所以基本所有的编程规范都在告诉大家&#x