An .editorconfig file is the first in a series of steps we need to make in the next couple months to ensure we maintain consistent coding styles regardless of what settings we each use in our code editors. It only has a couple config options, with tabs vs spaces probably being the most controversial.
After considering the pros and cons of both, my opinion is we should use tabs for indentation. The biggest reason for this is that tab width can be customized per team member, unlike spaces. If we decide to indent with 4 spaces, it will show up as 4 spaces for everyone. If we decide to indent with tabs, I can decide I like my tabs to be 4 spaces wide, but you can customize them to be 2 spaces wide in your editor if you prefer less indentation - at the end of the day it's just a tab character in the file...
Customizing your tab width
I've purposely not set the indent_size/tab_width in the .editorconfig so we're able to adjust this according to our personal preference.
An .editorconfig file is the first in a series of steps we need to make in the next couple months to ensure we maintain consistent coding styles regardless of what settings we each use in our code editors. It only has a couple config options, with tabs vs spaces probably being the most controversial.
After considering the pros and cons of both, my opinion is we should use tabs for indentation. The biggest reason for this is that tab width can be customized per team member, unlike spaces. If we decide to indent with 4 spaces, it will show up as 4 spaces for everyone. If we decide to indent with tabs, I can decide I like my tabs to be 4 spaces wide, but you can customize them to be 2 spaces wide in your editor if you prefer less indentation - at the end of the day it's just a tab character in the file...
Customizing your tab width
I've purposely not set the
indent_size
/tab_width
in the.editorconfig
so we're able to adjust this according to our personal preference.Vscode:
Text Editor → Tab Size
GitHub:
Settings → Appearance → Tab size preference