Open JanCVanB opened 2 years ago
Probably intentional. Roc is influenced by Elm, which is designed to make it easy to get started with a codebase that is new to you. It's why they banned custom infix operators, and maybe it's a reason to ban tabs.
Also, spaces are required by some disgusting code styles.
I think that Roc should require 4-space indentation because it's the default in many text editors. Roc should make it easy to get started without changing settings. For custom visual tab width, you will be able to use the Roc editor.
Is the Roc team's approach to tabs identical to the Zig team's approach? It sounds like the Zig team plans to support tabs but doesn't at the moment. The accessibility advantages of tabs mentioned in that thread are very compelling, I've never considered them before.
I just linked it because it was a very lengthy discussion with some cool information.
I agree, very useful stuff!
The un-answerable question is: How many spaces is a tab?
(Your editor says 4, my editor says 2, a browser says 8)
I think there are some sane ways to solve it:
^\t+
or ^ +
but never both..roc
file
I'm personally ambivalent on tabs vs. spaces for indentation, but I'm surprised that Roc takes such a strong stance against tabs. It seems that tabs are illegal anywhere except string literals and application names:
index out of bounds: the len is 11 but the index is 11
panic.Tab characters are not allowed.
error.Is this an intentional choice (to enforce consistency between developers? to enable the editor to use the tab key for features?) or is tab support on the roadmap?