Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tab characters must not be used as a replacement of whitespace characters #46

Open
javier-godoy opened this issue Sep 30, 2024 · 0 comments
Labels
agreed An agreement on the resolution has been reached

Comments

@javier-godoy
Copy link
Member

For Java sources we have the convention that "Tab characters are not used for indentation" (from Google Java Style Guide) and recently we got #43 (which among other things requires discussing which character to use for indenting XML files).

Regardless of the file format, tab characters should not be used to replace a specific number of whitespace characters, as their appearance cannot be consistently guaranteed across different devices.

While shunning tabs entirely feels too extreme, even unconventional indentation will appear consistent as long as tabs aren’t used in place of a specific number of spaces. For example, spaces and tabs could alternate based on the Fibonacci sequence (one space, one tab, two spaces, three tabs, five spaces). I’m not saying it’s a good practice, but it’s consistent.

·⟶··1)
·⟶··⟶⟶⟶1.a)
·⟶··⟶⟶⟶·····1.a.i)
·⟶··⟶⟶⟶·····1.a.2)
·⟶··⟶⟶⟶1.b)
·⟶··2)

but not

⟶1)
····2)

Then, we could add recommendations shunning tabs for specific formats.

@javier-godoy javier-godoy added discuss The issue is scheduled for internal discussion agreed An agreement on the resolution has been reached and removed discuss The issue is scheduled for internal discussion labels Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
agreed An agreement on the resolution has been reached
Projects
Status: In Progress
Development

No branches or pull requests

1 participant