Indentation TABS vs. SPACES
I don't know why it is so common to ban indenting with tabs and use spaces instead but I don't get it. I mean with tabs everyone can set up a good number of spaces which is good for reading, but if we use x spaces everywhere, then it is bad for a lot of people (for example for me, the most easiest to read is 4 spaces as tabs.).
Needless to say linters drive me crazy (puppet DSL, python - 2 spaces!) and I just HATE using spaces.
(Yes, thank you, I can set up my vim - but I don't want to. I just want to use literal TABS.) If you choose to use two space width tabs, and I choose to use eight space tabs, what does a one hundred and twenty column page width mean? What do your edits look like on my monitor? What do mine look like on yours? If you are both using tabs, for him everything is going to be indented with "2 space tabs" including your edits, and for you it is going to be indented with "eight space tabs", including his edits. Relevant: https://blog.codinghorror.com/death-to-the-space-infidels/ (2009) As someone who used to hate tabs, a lot of older software, specifically Solaris, would fail in severe ways if spaces were used in Unix config files - indent vfstab with a space? Congrats, your box is unbootable. I was NEVER TABS until someone else asked me to consider why, and now we use tabs for that reason: everyone can have their preferred width. Because people view source files using a multitude of means, and getting everybody across all their respective platforms to set things up is onerous. When you mix tabs and spaces there's no way to get alignment correct. Indentation is fine, if that's all you ever use them for, but human behavior is non-deterministic and unenforceable, making for completely hosed up source when tabs are used for anything other than pure indentation. E.g., if you put a tab in for alignment, when you should have used spaces, your source file is hosed up. Add on to that that many IDEs, editors, and build tool/tool hooks aren't smart enough to know when something is being indented vs. aligned, it's essentially impossible. I don't talk about mixing spaces and tabs. I talking about why don't we indent with tabs only? Spaces are good for separating tokens in code, but indentation is not for that - indentation is for making the structures visible, sometimes it is easier to read with smaller amount of indent, sometimes it is easier to read with larger amount of indent - based on my experiences. Why then to make the coders life worse than needed?
(On the other hand I do like Go's approach for this: using 'go fmt' you can make your source file well-indented/aligned.
sigh You cannot use tabs for alignment, and people align things. For a while, I liked spaces. But then I started programming on my phone. The screen is only 36 columns wide. With 4 spaces per level, 4 levels of indentation (not atypical, even for Python) makes that 20 columns. Takes up nearly half your screen. So if I am trying to code on my phone I need tabs so I can reduce the width of indentations and save as much space as possible. You can't vertically align elements with tabs when they are not a multiple of the tab length or all the same length. Until editors align properly with a single tab char (something even a word processor will not do) then spaces are the right way. Tabs are too variable for me, and on some (albeit ancient) platforms won't even display. Spacing with spaces is more universal (well except for HTML). If sometime in the future they device some new formatting standard it would likely supplant and deprecate tabs, but spaces I believe would always be a fallback option. If you work on a project solo it doesn't matter if you stay consistent (for yourself at least). if you work on a project with multiple collaborators pick one (i.e. tabs or spaces) and stick with it (i.e. enforce it during code reviews). I personally use tabs but those get expanded to 4 spaces by Vim. Works for me! Thumbs up if Silicon Valley brought you here...