Formatter: consider using tabs instead of spaces #3633
Replies: 4 comments 6 replies
-
Do we have any information on the accessibility concerns relating to tabs and spaces? |
Beta Was this translation helpful? Give feedback.
-
The downside to this is an increase in perceived strangeness of Gleam. Tabs are unpopular and 8 space tabs even more so, so adopting these will result in fewer people deciding to try Gleam, hurting our growth. Is there anything we can do to avoid GitHub etc showing Gleam with 8 space tabs? |
Beta Was this translation helpful? Give feedback.
-
Hi, just wanted to chime in that I am one of the people for whom this accessibility is a thing. 2-space indents makes it nigh-impossible to me to separate scopes. In space-obligatory languages I will use 8 space indents which (as was already pointed out) is a bad choice for many people and tabs are the only solution I know of to address this in a flexible enough way. As for the specifics, I would recommned trying to reformat some larger codebases and identify issues that look weird (sometimes a few linebreaks might be a better way) As for "legacy-support" I see a relatively simple option:
While not a great fan of keeping two modes around, I think the value of tabs is worth it. I am biased though, I will freely admit that. TL;DR: I have yet to find a case where indentation with tabs and aligning with spaces does not work as well, if not better than space-indentation. Also +1 for editorconfig. |
Beta Was this translation helpful? Give feedback.
-
Allowing an option in the gleam.toml file would be cool so that people who prefer tabs > spacing . Something like spacing="tab" . |
Beta Was this translation helpful? Give feedback.
-
From time to time someone in the Gleam Discord suggests the formatter could use tabs instead of spaces for accessibility reasons.
A couple of things that have emerged so far:
I've opened this discussion so people can chime in here if they have anything to add or any experience they'd like to share :)
Beta Was this translation helpful? Give feedback.
All reactions