Skip to content

Write page: Concepts > Whitespace #23

Open

Description

@vmbrasseur
No description provided.

Activity

  1. vmbrasseur commented on Feb 24, 2014

    @vmbrasseur
    MemberAuthor

    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
  2. vmbrasseur commented on Mar 11, 2014

    @vmbrasseur
    MemberAuthor

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions