Skip to content

fmt tabs vs spaces for indentation #14

@adlerjohn

Description

@adlerjohn

John suggests the formatter of the HLL by default should use tabs for indentation instead of spaces, configurable via an option.

Reason: tabs allow different people with different preferences and potentially impairments (e.g. a visual impairment that requires 8-width indentation to read code properly) to view the code however they like, without affecting the code. Spaces don't allow this, and otherwise offer no tangible benefit over tabs, other than playing slightly nicer with max-line-width formatting.

(The max-line-width argument doesn't rule in favor of spaces however. If someone likes 8-width indentation, with a max line of 80 chars they may end up with a max line of 84, or 88, or more chars (depending on the indentation level). Spaces don't fix this though, because if that same user made each indentation 8 spaces temporarily while working, they would end up in exactly the same situation!)

A counter-argument would be that modern languages have all gravitating towards using spaces and no one uses tabs anymore, but this is not true: Golang is both a modern language and probably the most popular language for building blockchain clients, and its default formatter uses tabs for indentation.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions