fslang-suggestions
fslang-suggestions copied to clipboard
Suggestion: coding support for visually impaired people specific to F#
Since reading that post I've been certain to start new codebases with tabs instead of spaces (which I personally did prefer all the time). Until I realized that that's not really an option for F#, except when using verbose syntax. Which probably will not go nicely with the sparse tooling support we enjoy right now.
So my only option would be to ignore it and hope for the best. But then again:
from that moment onward, i couldn't imagine writing code in spaces under the presumption that "nobody with visual impairment will ever need to work with this code, probably", it's just a ridiculous way to think, especially in open-source
I do not expect a quick solution, if there's a way to solve this at all. But maybe it can be considered and discussed.
Copied & pasted from https://github.com/dotnet/fsharp/issues/9424
Just wondering: tooling gives us scope lines for each indentation level. Which means that designing something that's visual, it even auditive, is possible for these virtual tab stops, even if there are only spaces in the source file.
Perhaps it's also possible to make these lines stand out in a certain way, or even fill up with a contrasting color, to help visually impaired people. That way the language doesn't have to change, but the IDE tools do.
I think being inclusive towards the visually impaired would be a good goal by itself, but maybe we should hear from a specialized organization what they really need to make the language available to them (it may be more than just the spaces vs tabs discussion), so we can focus on that.
I've adjusted the title and will keep this open as a suggestion. The use of TABs isn't an option for use given the decisions already made.
In general accessibility is done at the IDE level for different IDEs, so we'd consider it out of scope for the language design. Would be interesting to compare with Python support to see if they do anything language-specific. And yes @abelbraaksma is correct that asking a specialized organization would be good
@aspnetde Repeating the same point as stated in the original post is not adding any new data points.
Since apparently someone banned my main account from talking (or even editing) in this thread, I would just like to add a clarification statement to my comment above: "Specifically, this does not change anything @dsyme said."
Since apparently someone banned my main account from talking (or even editing) in this thread..
@Happypig375-shared Can you message me on Slack? I don't know of anything like this and I think it would certainly be a mistake, especially on this thread where we want community input.
I do see your comment from @Happypig375 an hour ago https://github.com/fsharp/fslang-suggestions/issues/888#issuecomment-1168919119
(Looks like some automatd GitHub spam check kicked in , we'll see if the problem persists)
Repeating the same point as stated in the original post is not adding any new data points.
Thank you for that valuable contribution. Apparently, Marco Zehe provides specific details on how spaces make his developer life in front of the screen reader miserable. Details that are not provided in that depth in the originally mentioned Reddit post.
I'm genuinely curious, is this not something addressed in any editor? IDEs already understand tabs vs spaces and can indent/outdent either scheme and convert between them (at least at BOL). I'm surprised there isn't some optional setting/plugin/etc. somewhere to visually render spaced indent blocks as tab characters, thus working with any language and any screen reader, while preserving them as spaces in the underlying data.
@zanaptak indeed, that was my original suggestion, which is also how most IDEs work. They show multiple spaces as tabs, with vertical indent lines and when you use backspace it’ll remove a whole ‘virtual tab’, not just one space.
Many people I know use two spaces indentation, which would occupy less space than the the three cells occupied by a single tab as @aspnetde writes. Just set Fantomas to two spaces and it’d be more efficient than single tab on Braille displays.
Still think there ought to be wider discussion on improvements for visually impaired people, but that could also be done with language helpers, screen readers and IDE plugins.
I guess it might be a non-insignificant effort, but surely it should be possible to allow using only tabs instead of only spaces for indentation, and only disallow mixing tabs and spaces. Some things that are common in F# aren't tab-compatible, most notably list and record alignment:
let x =
[ { x = 1
y = 2 } // <-- must be exactly 2 spaces further than {
{ x = 3 // <-- must be exactly 2 spaces further than [
y = 4 } ] // <-- must be exactly 2 spaces further than {
But this can always be rewritten as:
let x =
[
{
x = 1
y = 2
}
{
x = 3
y = 2
}
]
@Tarmil ftfy (remember that right hand side of = and let can indent as well)
let x =
[
{
x = 1
y = 2
}
{
x = 3
y = 2
}
]
Well the point would be that if you use tabs then you can't use indentation that relies on the width of anything other than a tab. (which, as a side note, I don't like to do anyway)
