Code Style
Tabs vs Spaces
The classic indentation debate. Tabs are a single character that each developer can render at any width; spaces produce identical alignment everywhere.
Side-by-side comparison
| Tabs | Spaces | |
|---|---|---|
| File size | Smaller (1 char) | Larger (n chars) |
| Customizable width | Yes (per developer) | No (fixed) |
| Accessibility | Better (adjustable) | Fixed width |
| Consistency | Can vary by editor | Identical everywhere |
| Common in | Go (gofmt), Make | Python (PEP 8), JS/Prettier |
When to use Tabs
- You value adjustable indentation width
- Accessibility (e.g. larger indents)
- Languages/tools that mandate tabs (Go)
When to use Spaces
- You want pixel-identical alignment everywhere
- Following PEP 8 / Prettier defaults
- Mixed-content alignment
Bottom line
There is no universal winner — what matters is consistency within a project. Let an autoformatter (Prettier, gofmt, Black) decide and enforce it so the debate never recurs.