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

Write page: Concepts > Whitespace #23

Open
vmbrasseur opened this issue Jan 7, 2014 · 2 comments
Open

Write page: Concepts > Whitespace #23

vmbrasseur opened this issue Jan 7, 2014 · 2 comments
Milestone

Comments

@vmbrasseur
Copy link
Member

No description provided.

@vmbrasseur
Copy link
Member Author

Link this to coding conventions.

The matter of whitespace is a religious one in many software development circles. It starts more arguments than the question of "What's the best text editor?" (link to text editor page)

While there are many different types of whitespace which matter to people in software development, one of the most contentious points is that of the number of spaces in a tab stop (link to tab stop definition). The most common number of spaces are 2, 4, and 8. Most projects will choose one of these and use it consistently in all files. This allows for continuity in the flow of the code, making it considerably easier to read. For instance, this:

Example of code using consistent tabstop size

Is much easier for a programmer to read than this:

Same code sample but with differing sizes of tab stops

Before you start working with a project's code, check the (link to coding standards) coding standards (if it exists), the wiki, new contributor documentation. If you don't find something telling you about the preferred number of spaces in a tab stop, ask someone (link to where to ask). If you don't do your homework to learn the preferred number of spaces to use in a tab for that project, then use the wrong number of spaces and commit the code, you may get off on the wrong foot and annoy other members of the project community.

  • Question of whether to use spaces or tab characters
  • Effect of whitespace changes on diffs
  • Whitespace-only commits

@vmbrasseur
Copy link
Member Author

To reinforce the "religious issue in software dev" point, perhaps screen-cap this Tweet:

https://twitter.com/holman/status/441647555030441984

That captures the issue nicely. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant