Dealing with the “Silicon Valley” tabs versus spaces argument

The whole issue, of tabs versus spaces, which was dealt with on “Silicon Valley” last week, is easily resolved. No need to lose your super-genius girlfriend. In the show, she is shown hitting the space bar over and over when she could just hit tab a few times.

Of course the issue is that tabs can be interpreted visually in very different ways. Microsoft Word seems to want you to reset your tab stops for each line, or some other foolishness that I can’t quite wrap my brain around.

The answer is that you can use whatever you want, and can use .vimrc to change tabs to spaces if necessary. Since I am not working on the Linux Kernel, and often work with YAML, I have expandtab and tabstop set to 2. This allows me to nest loops with 2 spaces and never create a YAML file with tabs (which throws an error).

set tabstop=2 softtabstop=0 expandtab shiftwidth=2
— from .vimrc

Leave a Reply

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