In the world of programming, there are two kinds of developers: Those who prefer tabs, and those who prefer spaces (for some ungodly reason). You might ask why this even matters; “It’s the same thing,” some might say…but no. No. No. No, it isn’t the same thing at all.
For obvious reasons, tabs aren’t always the way to go. The company you might work for could have coding standards that say to use spaces to indent the next line of code, if necessary. I don’t blame you for being forced to use them; however, in this case, your company is wrong. But I do blame you for not telling the designer of your coding standards that tabs are better than spaces, and should be used. If you have insisted on tabs instead of spaces…well, kudos to you!
Below are two images with the same code. One uses spaces, the other tabs.
Human readability is the leading reason a developer should use tabs. When coding standards specify tabs amongst other styles of coding, it is there to keep the company’s code uniform. This helps when someone else is assisting in writing code, re-writing code, or finding bugs in code. Code that is non-uniform and not correctly formatted makes the reading of code much harder, increasing the scope of work, as well as time needed to fix and/or repair any code that contains errors, which ultimately increases the amount of money needed to get the job done.
If everyone in the workplace is using the same tools (Eclipse, DW, Notepad++, etc.), then it is possible to align their programs to the same coding styles and/or standards. An auto-formatter generally exists in each program, and should be set up as such. With respect to tabs and spaces, you can set up tabs to equal 4 spaces: 1T = 4S.
Use tabs. Avoid spaces. Have a good set of coding standards within the company. This will not only help with the code’s readability, but also increased efficiency, as a whole.