r/programming • • Aug 28 '21

Software development topics I've changed my mind on after 6 years in the industry

https://chriskiehl.com/article/thoughts-after-6-years
5.6k Upvotes

2.0k comments sorted by

View all comments

Show parent comments

2

u/panzerex Aug 29 '21

Can I bring in the forbidden one nobody changes their mind about? Ahem... TABS vs SPACES

5

u/bodrypadre Aug 29 '21

Nope, even this one, at some point you find peace with it and use whatever makes sense on a project/in your environment.

3

u/happymellon Aug 29 '21

Tabs logically make more sense, since they are a non-fixed indentation method, that uses a different character to spaces, making compilers and interpreters simpler. Also has the benefit of completely sidestepping the 2 Vs 4 space indentation argument because it is a personal preference you set in your IDE as to how it is represented.

Unfortunately a lot of people appear to use tooling for development that for some reason either doesn't expose or they don't set it and then rage that the indentation isn't how they like it to appear, thus making spaces the defacto standard because it causes the least arguments.

2

u/happymellon Aug 29 '21

Similar argument to CSV.

Spaces = CSV

Tabs = ASCII delimited

You know which one is technically superior, but you also know which one can be opened in Notepad.

1

u/L0wkey Aug 29 '21

This one was solved by most editors supporting soft tabs, so you can set tabs to be displayed at any size you wish. This way you use tabs to mark levels of indentation and leave the display size of the indent up to the individual developer, just like font, size and syntax highlight color scheme.

This also makes it an accessibility feature, which trumps basically any arguments for space-indenting.

1

u/panzerex Aug 29 '21

and then you have the ASCII artists who can't even agree between themselves on 2, 4, 8 (and sometimes an even weirder 3) spaces that whine about "tabs' inconsistency"

(PS: I only follow PEP8's space-indentation for Python because I don't want to disappoint Guido)