the coding holy war

tabs or spaces?

By Laura Laney | Cynerge Consulting

Recently, I stumbled upon the age-old Coding Holy War that quietly wages in the background anywhere code is written. This war is so heinous it has potentially relationship-ending consequences among web developers and is often compared to the blowout between Richard and Winnie in the hit IT show, Silicon Valley. Cynerge’s very own developers are similarly afflicted and enthusiastically engage in an almost cult-like bashing of the “other” side. Driven by my own naturally inquisitive nature, desire to understand my colleagues, and slight attempt to wreak havoc for a day, I devised a questionnaire to better understand this ritualistic behavior.

For those unfamiliar with the life divide that is tabs or spaces, it boils down to a spacing mechanism to make code more readable for people. Is it more efficient to hit tab once, or is it more oddly satisfying to hit the spacebar four times?

These are their stories (DUN, DUN):

AWS Consulting Partner Badge

While this seems logical enough, Cynerge’s Chief Technology Officer, Mike, and lead Developer, Brian, took the questionnaire to a whole new maturity level. Brian was of the opinion that tab-users are “inferior human beings” with Mike suggesting that it’s a matter of efficiency,calling space-users “masochistic,” and doubling down on tabs being the obvious choice, stating that “it’s easier, cleaner, compiles better, makes linting easier, and is what true light-speed developers use regardless of what Brian might say.”

Shelby called the whole debate ridiculous, agreeing with Brian that “spaces— and always twospaces, no more, no less . . . will always line up no matter what editor you use.”

When asked if one of the more prominent arguments of spaces making code more flexible were true, the responses varied immensely. Mike agreed that spaces make code more flexible if you would, “ . . . rather paint a 10’ x 12’ wall one color with a roller or with eight colors and a paintball gun. Sure, it’s more flexible, but it will look like crap.” Continuing the feud, Brian likened using spaces to practicing yoga, reiterating that it makes you a better human being and,of course, makes code more flexible. Nick asked why it would make code more flexible and Andrew tried to keep the peace with his supposition that spaces could make code more flexible.

Chris maintained a sense of decorum explaining that theusage of spaces does ensure flexibility across systems and ensures your fellow developers won’t have issues with compilation if they have a different tab ascii character than you.”

Shelby states that flexibility works with tabs too, going as far to suggest the retaliatory action of setting “. . . tabs to look like two spaces, and then indent four times for an eight-space indent. And then screw over anyone with the less flexible eight-space tab.”

The counter argument for tab-users appears to be that tabs make code more readable and aesthetically pleasing. However, Shelby disagreed, explaining that “tabs in place of spaces do nothing more than confuse everything and interfere with multiline-search.”

Brain agreed with Shelby: “. . . tabs make code more inferior, and it’s not an opinion, it’s a natural law.” Mike, however, agreed enthusiastically with this statement, suggesting that if your code doesn’t look cool, you’re not really coding.

Nick and Andrew agreed with Mike, with Nick going so far as to call tabs “majestic.”

While researching this highly contentious topic, I came across the interesting statistic that space-users have a slightly higher salary by an average of nine percent compared to their tab-using colleagues. Brian was unimpressed, agreeing that winners always make the most money. Mike fired back with the fact that space users enjoy “ . . . mundane tasks, like pressing space eighttimes . . . and have more time to dedicate towards salary negotiations.”

Nick’s opinion is that at least he can read his code and Chris was not surprised, agreeing that higher paying tech jobs tend to be for new systems that lean towards using spaces over tabs, with new in-demand jobs paying more than standard programming jobs. Shelby calls the statistic into question saying it has nothing to do with spaces and more to do with language conventions,calling it meaningless and uncontrolled.

When asked what they thought about Bill Gates, whose net worth is $89.2 billion, preferring tabs, Andrew wasn’t surprised in the slightest, calling him a “robot alien.”

Nick agreed too, saying Mr. Gates “. . . knows what’s up.”

Brian indignantly called Mr. Gates “a burglar” and had to clarify his previous statement with the addendum that space-users do not condone criminal activity,” and being a criminal disqualifies him from the law of being ultimate champion via most money.

Shelby had no feelings either way, “because what applies to a near-monopoly of a tech giant that’s been around since the seventies does not apply to new or open source projects from companies that can’t swing their weight around.”

After having sufficiently raised everyone’s blood pressure and derailing several far more important discussions, I was reasonably satisfied that my work here was done. Based on my entirely unprofessional, never-having-coded-anything-a-day-in-my-life opinion, it appears that tabs or spaces are entirely dependent on your coding style, language, and equipment. Most of the web developers at Cynerge preferred tabs over spaces with their coding style, except for Brian and Shelby, who then did me the courtesy of correcting the spacing in my questionnaire.

Related Case Studies and Blogs

Michigan Activity Pass

Michigan Activity Pass

Michigan Activity PassWhat is MAP?Cynerge and LocalHop have partnered with The Library Network (TLN) for providing the Michigan Activity Pass (MAP) which is a statewide collaborative program between Michigan’s public libraries and participating partner destinations....

read more
A Feature on Pictured Rocks

A Feature on Pictured Rocks

A Feature on Pictured RocksHappy National Park Week!By Laura Laney | Cynerge Consulting While the National Park System (NPS) and the National Forest Service (NFS) are different entities, they share common borders among their combined 277 million acres. With the NPS...

read more
AWS re:Invent Conference, Las Vegas NV

AWS re:Invent Conference, Las Vegas NV

AWS re:invent conference, las vegas nvtech exploration and diving deep, team cynerge attends dynamic global cloud computing eventBy Laura Laney | Cynerge Consulting A futuristic and power-driven atmosphere of achieving the impossible awaited Team Cynerge at the AWS...

read more