3 ms·
Their rationale for enforcing spaces over tabs is nonsense, particularly after you dive through their GH issues, find where this is discussed, and see the true
by 000ooo000 4y ago
Their rationale for enforcing spaces over tabs is nonsense, particularly after you dive through their GH issues, find where this is discussed, and see the true reason is implementation simplicity.
- otherme123 4y agoImplementation simplicity also sounds good to me. BTW, it's discussed in the manual: Nim's standard grammar describes an indentation sensitive language. This means that all the control structures are recognized by indentation. Indentation consists only of spaces; tabulators are not allowed. The indentation handling is implemented as follows: The lexer annotates the following token with the preceding number of spaces; indentation is not a separate token. This trick allows parsing of Nim with only 1 token of lookahead.
- elcritch 4y agoOnly allowing spaces was a good decision. It was supposedly inspired by a quote from Guido bin Rossum that if he could redo it he’d only allow spaces in Python, or something along those lines. It eliminates lots of issues mixing code that has tabs or spaces like in Python. I’ve never had to worry about a lingering tab.