Updated Whitespace FAQ (markdown)

This commit is contained in:
Daniil Yarancev 2017-08-25 13:59:41 +03:00
parent 452115d07b
commit e3169bded2
1 changed files with 1 additions and 1 deletions

View File

@ -50,7 +50,7 @@ Either the indentation is wrong, or the program is buggy, because an "else" alwa
### Tabs vs Spaces
This is a non-issue in Nim, as only spaces are accepted as an indentation character --- a syntax error will be thrown if the compiler detects tabs being used for indentation (though this can be worked around by using a [syntax filter](http://nim-lang.org/filters.html)). However, languages that allow both of them to be mixed are dangerous. Some languages, like python 2 by default (fixed on python 3), tries to convert a tab to a certain number of spaces, and thus an indentation error introduced by mixing tabs and spaces will only be detected as a run-time failure. Other languages, that ignores any type of indentation, will generate code that behaves differently than it looks at first sight when using an editor with different tab-stops configuration. This can hide/introduce bugs, like in the previous C/C++ example.
This is a non-issue in Nim, as only spaces are accepted as an indentation character --- a syntax error will be thrown if the compiler detects tabs being used for indentation (though this can be worked around by using a [syntax filter](https://nim-lang.org/docs/filters.html)). However, languages that allow both of them to be mixed are dangerous. Some languages, like python 2 by default (fixed on python 3), tries to convert a tab to a certain number of spaces, and thus an indentation error introduced by mixing tabs and spaces will only be detected as a run-time failure. Other languages, that ignores any type of indentation, will generate code that behaves differently than it looks at first sight when using an editor with different tab-stops configuration. This can hide/introduce bugs, like in the previous C/C++ example.
## Deep nesting