Why are tabs evil?
The main point of using tabs for indentation is to not lock the indentation offset. Hence,
- Tabs are evil whenever they require you to know the tab size in advance.
There’s a number of ways this requirement may come about, and a number of ways to address it: no tabs (duh), no alignment (cruder formatting), and smart tabs (tabs for indentation and spaces for any alignment).
How editors handle indentation …
Tabs and alignment
This is Emacs’ default behavior. Well, sort of. By default, the tab size (the distance between tab stops) and the indentation offset (the number of columns an indented line is shifted to the right) have different values. Nothing good can come of this arrangement. Below, we’ve set them both to 4
, so that one tab (‘--->
’) corresponds to one indentation level:
1 int foo(char bar[]) { 2 --->int i = 0 3 --->while(bar[i] != '