Spaces or Tabs

21 Sep 2016

It All Started With Spaces

When I first started programming I would always use tabs to indent and format my code. I thought it easy because all I needed to click had been one key on the keyboard. It was so easy and I had been extra lazy back then. All I needed to do was move my left pinky finger a few centimeters up and to the left of where it usually rest on the keyboard and gently click away. It was that simple, why would I want to use spaces and have to waste energy clicking multiple times and having to keep track of how many spaces I needed to match my current line with a previous one. I thought it was really cumbersome using spaces when I had a really long function and multiple nested loops and conditionals. There was just so many spaces to click.

Then one day I started messing around with different programming environments and software hosting platforms like Github. Very often, when I would uploaded projects, the format on the newly uploaded files would not reflect the format I had on my own personal device. Indentations would be everywhere, some shorter and others longer than what I had when I wrote the code. This had given me reason to start using spaces instead of tabs. My code would from then on have the same indentations no matter where I sent it. I’m not saying that it’s correct or it’s better for everyone but it worked for me. I have the same opinion regarding coding standards. I believe that having coding standards can hamper the efficiency of a programmer if the standards conflict with their style of coding.

But It's Not All Bad

Even though I am not behind coding standards I do believe that there are also benefits. One benefit I can imagine with a big tech company implementing a strict coding standard for programmers is the ease of understandability. What I mean is, if a big company, like google or amazon, has many coders coming in and out of employment newly hired coders can quickly understand the code they are working with if their own coding standard is applied strictly.

I’m still not sold on coding standards but my experience in the business is sparse. I may change my views later when I am working on bigger and bigger projects.