Tabs vs Spaces

Have you ever opened a source code file only to have your lower jaw slack aghast as you discover no indentations or worse alignments applied helter-skelter? Tabs vs spaces is a coders crusade with fields ever green.  I can recall meeting people with strong opinions all they way back to grade school.  It’s akin to other code sibling rivalries like indent/brace styles.

Behold this monster linux kernel trap thread where Linus himself weighs in autocratically for 8 column wide hard tab stops which are the code style standard for both the linux kernel and git projects.  At the opposite spectrum Coding Horror comes down in favor of spaces. Notice the spectrum’s advocates hail from the polar worlds of unix and windows respectively – let’s let sleeping dogs lie shall we?

My initial delve into this topic was driven by a desire to correct some files recently migrated from cvs to git at work.  The primary concern was stripping cvs ‘$Id:’ tags lines from the headers of all files and deleting CVS metadata directories.  The scheme occurred to kill two birds with one stone and align the code files on a standard.  However, my idea of an alignment standard may not jive with the teams nor the companies approved standard. I plan to apply the cvs fix pronto and discuss internally which alignment standard to apply.

Author: admin

Share This Post On

Submit a Comment

Your email address will not be published. Required fields are marked *