Tools: Hard Tabs

Created on 14 May 2020  路  5Comments  路  Source: rome/tools

People are allowed to have opinions on how much visual indentation they want in their code. When I first started coding I found 4-space indentation to be really helpful when I would easily get lost in my code. After a few years I preferred 2-spaces. So there is an argument to be made about accessibility.

People have debated endlessly about tabs vs spaces, and ultimately most of people's opinions are just a bit silly. There is only one consequential difference between the two:

Tabs allow individuals in the same codebase to select their indentation widths across every tool (yes including GitHub using either the .editorconfig or a user-style with tab-size), and spaces do not (at least not across every tool).

As such, I think we should switch to hard tabs for everything in Rome.

I'm gonna make a request that people refrain from flooding this thread with subjective opinions about if 2-space width code is better than 4-space width code. You are welcome to have your personal preference, that is the entire reason for choosing hard tabs.

Most helpful comment

Just to confirm the accessibility issue: https://www.reddit.com/r/javascript/comments/c8drjo/nobody_talks_about_the_real_reason_to_use_tabs/

coworkers who unfortunately are highly visually impaired, and each has a different visual impairment:

  • one of them uses tab-width 1 because he uses such a gigantic font-size
  • the other uses tab-width 8 and a really wide monitor
  • these guys have serious problems using codebases with spaces, they have to convert, do their work, and then unconvert before committing

All 5 comments

One change I'm going to work on now is making sure that tabs render correctly in buildMessageCodeFrame. We should render \t as and make sure the pointer aligns.

Just to confirm the accessibility issue: https://www.reddit.com/r/javascript/comments/c8drjo/nobody_talks_about_the_real_reason_to_use_tabs/

coworkers who unfortunately are highly visually impaired, and each has a different visual impairment:

  • one of them uses tab-width 1 because he uses such a gigantic font-size
  • the other uses tab-width 8 and a really wide monitor
  • these guys have serious problems using codebases with spaces, they have to convert, do their work, and then unconvert before committing

Thank you for sharing this. I had never thought/considered the accessibility concerns of using spaces

Merged #439. I'll make the indentation change once I've merged the outstanding PRs.

Opened #443 to switch us to hard tabs. I also opened #442 to discuss switching to double quotes.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sebmck picture sebmck  路  5Comments

yoshixmk picture yoshixmk  路  4Comments

RaviVaranasi picture RaviVaranasi  路  5Comments

shirshak55 picture shirshak55  路  3Comments

ChristopherBiscardi picture ChristopherBiscardi  路  5Comments