#coding_style 왜 Linus Torvalds는 8칸 tab을 사용할까?

less than 1 minute read

Now, some people will claim that having 8-character indentations makes the code move too far to the right, and makes it hard to read on a 80-character terminal screen.

The answer to that is that if you need more than 3 levels of indentation, you’re screwed anyway, and should fix your program.

Linux Kernel Coding Style - Linus Torvalds

걍 8이 좋아서. 이게 아니다. 들여쓰기 레벨을 규제하려고 8칸 tab을 사용한다.

들여쓰기 레벨을 3 이하로 할 것을 권고한다. 이렇게 문서로만 살아있는 지침보다 더 큰 효력을 지닌 코딩 컨벤션(coding convention)이다.

코딩 컨벤션을 정할 때, 토론이 필요한 건 이렇게 결과를 이끌어 낼 수 있는 규칙이다. 취향에 따라 갈리는 공백 위치 같은 건 다수결로 채택하거나 팀장이 그냥 정해도 상관없다고 생각한다. 통일만 되면 장땡이니깐.