Live data from Hacker News

Ask HN: How should a programming language accommodate disabled programmers?

news.ycombinator.com

41–50 of 122 posts

Re: Ask HN: How should a programming language accommodate disabled programmers?

#41
post #39

I've seen some programmers code using voice. This is really handy for people without functiong hands or fingers. They tend to use voice recognition software like Dragon and various plugins. I'd say from a programming language point of view, having keywords that are short (single word would be ideal) and phonetically distinct is really important. One python programmer I watched on Youtube made his own vocabulary of st…

This might be the programmer in question. Pretty impressive. https://www.youtube.com/watch?v=8SkdfdXWYaI

There are several other newer resources:

https://github.com/melling/ErgonomicNotes/blob/master/progra...

Re: Ask HN: How should a programming language accommodate disabled programmers?

#42

Slightly off-topic: how do blind programmers read code? Does the screen reader recite it aloud and just say "int main left-paren void right-paren open-brace int i equals zero...", or does it use some other kind of auditory vocabulary to make it more meaningful to the listener? I've been thinking about this alot lately because I've been wondering how I could get better at programming while driving on my daily commute.

The blind people I have known use a Braille display to work with a computer https://en.wikipedia.org/wiki/Refreshable_braille_display

Braille’s somewhat dying off as screenreaders become more integrated into computer systems - a system reading to you (usually at 3x speed as well) has massively more information density than a Braille display, to the point that it’s becoming less usual to learn Braille in the first place.

Re: Ask HN: How should a programming language accommodate disabled programmers?

#43
Hey, kudos to you for thinking about this! Background: I'm totally blind, have programmed for nearly 3 decades, kind of do the in and out of half a dozen languages thing these days. Today's favorites are Rust anywhere I can get away with it, Python because it runs in places where I need it (Home Assistant, Mycroft, etc.) and JavaScript because if I hold my nose and don't think too much about the atrocities I'm committing, I can run the same or similar code in various form factors. I'll try to give a few pointers. Note that these are specific to blindness, and specific to me. I don't claim to speak for the disabled population as a whole, as we're kind of a grab bag.

1. Indentation: Pretty much a solved problem at this point. If I were reading Python code line-by-line, my editor might speak something like (not sure if my newlines will make it, but imagine them where they should be): def hello(world): 4 spaces print("Hello, world.") 4 spaces 1 tab 4 spaces print("What was I thinking when I indented this line?")

So I wouldn't worry too much about that. I've never had issues with an indentation-based language, and anyone blind who does likely just needs to change their tooling a bit. This is usually just a checkbox in the screen reader settings, so doesn't even usually require an editor/IDE change.

2. Avoid crazy symbols. Scala gave me some grief with this, with every library author having method names like %^&@^$# because I assume that set of symbols looks like performHttpRequest(...) in some visual way. I exaggerate a bit. Only a bit. Note that operator overloading is fine, at least from an accessibility perspective. It's when people decide that a series of connected punctuation symbols evokes the idea of making an HTTP request or opening an Option that I start to get annoyed.

3. Create good command line tooling. Rust has this nailed. I like how Rust's own installer just uses rustup under the hood, or at least I think it does, and every blog post advertising a new component also includes the rustup incantations to grab it. I assume the editor interfaces are as nice or nearly so. I guess the takeaway is, package your language installation tooling in a library so you can invoke it from the CLI, editor plugins, etc.

4. Put error messages at the bottom of stacktraces rather than the top. Python does this right, and everyone else gets it wrong[1]. Say you're running a compiler from your command line. You get an error, and your cursor lands on the input area, ready for a new command. As a screen reader user, you discover that error by entering your window's review mode and moving up. With JavaScript, Rust, and just about everything else, I have to arrow through the callstack in reverse as I move up the screen to the line containing the error. Python puts this error last, near the input cursor, so all you're doing is arrowing up a couple lines. It's a few seconds per error, but can add up immensely over the course of a day. NPM, infuriatingly, shows the error, followed by disclaimer text that the error isn't in NPM, then barfs up an NPM error just to confuse things. So any JS package I use that uses NPM for its scripting requires arrowing back through 2 stacktraces to find the original error. It's enough to drive me to drink.

I can probably come up with more, but I haven't finished my coffee yet. Perhaps that's a good thing...

1. Right and wrong are of course subjective. This is just one blind dude's opinion, take it for what it's worth.

Re: Ask HN: How should a programming language accommodate disabled programmers?

#44

One of the software engineers where I work is completely blind. I've never had a chance to interact with him as he's in a remote office unfortunately. He mainly writes in Python, bash, and C. From what I understand, every project he works on has strict formatting requirements (can't commit until the linter passes, etc.) and his screen reader is programming language aware. Although, to be honest, I feel that the thing…

I would find it very interesting to read your coworker's account of what programming is like. Or anyone's account who has to approach programming differently compared to the average person. I'd love it if more people blogged in general.

Re: Ask HN: How should a programming language accommodate disabled programmers?

#45

Hey, kudos to you for thinking about this! Background: I'm totally blind, have programmed for nearly 3 decades, kind of do the in and out of half a dozen languages thing these days. Today's favorites are Rust anywhere I can get away with it, Python because it runs in places where I need it (Home Assistant, Mycroft, etc.) and JavaScript because if I hold my nose and don't think too much about the atrocities I'm commit…

Do you use a Python auto-formatter called black, or if not, do you think consistency helps (e.g. shorter lines, same constructs/indentation) or hinders (e.g. shoter lines means more lines means more noise)?

Re: Ask HN: How should a programming language accommodate disabled programmers?

#46
Blind programmer checking-in, here are a few thoughts sparked by the comments that I’ve read…

Disclaimer: these are my thoughts, and should not be generalized to all blind programmers.

First, let’s start with the supporting technologies, mainly screen readers. The most popular screen reader is Jaws for Windows (expensive product), followed by Non Visual Desktop Access (opensource product), distantly followed by VoiceOver (your only choice for Apple products). My main day-to-day driver is NVDA, but I also use Jaws for my job. I do not use a braille display. The IDEs that I use are Visual Studio (C# development) and Visual Studio Code (Python and Javascript development).

Indentation-sensitive languages such as Python really aren’t that difficult to use, once you figure out how to get your screen reader to announce indentation levels. Typically, the screen reader only announces indentation changes when there is a difference from the line that you are coming from. A sample Python function would read as follows as I press the down-arrow to read line-by-line (note that I’m purposely not putting in line breaks, since an audio-based screen reader is inherently serial):

“def foo left paren right paren colon, four spaces number say hello world, print left paren quote hello world quote right paren, zero spaces blank”

Interestingly, I find lisp one of the most difficult languages, since there are so many parentheses, and it’s difficult to keep track of what nesting you are in.

Screen readers are not programming language aware. It’s all text to them.

Using pitch to communicate information is more distracting than anything. Imagine that you were having a conversation with someone, and every few words, their voice completely changed. It makes understanding the meaning of what they are saying more difficult, since your brain is too busy going “hey, something changed!”

Some additional reading that I recommend is “An Exploratory Study of Blind Software Developers”, which can be found at https://ciigar.csc.ncsu.edu/files/bib//Mealin2012-BlindDevel.... That identifies some programming challenges that participants face, as well as some of the areas that blind programmers self-report as excelling in. Full disclosure, I was the primary researcher on that study.

Finally, a mini soapbox rant: something that I see quite often is people doing blindness “simulations” for a short period of time. They then write up their experience, which isn’t a bad thing, but then present their work as “I found this hard, so all blind people must find this hard.” Identifying when a task has a large learning curve is important, but also do keep in mind that people who are blind have significant experience in identifying ways to overcome potential accessibility problems.

Re: Ask HN: How should a programming language accommodate disabled programmers?

#47
post #26

Lisp: - Avoids the use of gratuituous special characters: (a b c) - use-dashes-in-symbol-names-instead-of-underline-so-its-easier-to-type (you can still use underlines or most any special character, but we like to keep it simple and easy). - has a simple prefix syntax, that makes it easier to read and understand complex expressions: (loop (print (read (eval))) So no risk of confusing special characters or syntax: the…

> is not whitespace-sensitive, how can you see the size of whitespaces when you're blind? Can't indentation be handled by the IDE as having a meaning like "root class declaration", "function declaration", "nested block 1", "nested block 2"? Indentation has meaning and meaning can be converted. Even Xcode seems to be context aware as I can choose where certain code block shortcuts can or can't be executed. "This is a…

If you are willing to restrict a programmer to only look at accessible renderings of the AST, then there is probably nothing to consider, but a programmer's job is also handling what happens when a program does not parse.

Re: Ask HN: How should a programming language accommodate disabled programmers?

#48

Lisp: - Avoids the use of gratuituous special characters: (a b c) - use-dashes-in-symbol-names-instead-of-underline-so-its-easier-to-type (you can still use underlines or most any special character, but we like to keep it simple and easy). - has a simple prefix syntax, that makes it easier to read and understand complex expressions: (loop (print (read (eval))) So no risk of confusing special characters or syntax: the…

I think the places where it does use punctuation are a lot more friendly to people with low vision than most languages: you never use awkward combinations like '),' where it's easy for the comma to blend in with the bracket (the comma in ',(' stands out a lot more), you don't write things like 'if (!pred)' where the bang similarly blends in, etc. The general preference for descriptive names over punctuation for operators is really helpful, too, as it lets you rely much more on the basic shape of the word.

Re: Ask HN: How should a programming language accommodate disabled programmers?

#49

Hey, kudos to you for thinking about this! Background: I'm totally blind, have programmed for nearly 3 decades, kind of do the in and out of half a dozen languages thing these days. Today's favorites are Rust anywhere I can get away with it, Python because it runs in places where I need it (Home Assistant, Mycroft, etc.) and JavaScript because if I hold my nose and don't think too much about the atrocities I'm commit…

Do you use a Python auto-formatter called black, or if not, do you think consistency helps (e.g. shorter lines, same constructs/indentation) or hinders (e.g. shoter lines means more lines means more noise)?

Haven't thought much about line length. I tend to write longer lines just because I don't see the point on the screen where they'd logically break, and when I'm arrowing through code, I generally prefer to hear as much of a construct as possible without having to arrow 4-5 times through a single statement. If I'm calling something on a long list or string then I might break the list out over several lines, but if I'm dealing with a single long function call then I just let it go long. Formatters are certainly fine, it's just annoying to find and configure them for each language I use.

Re: Ask HN: How should a programming language accommodate disabled programmers?

#50

It is interesting that you're getting a lot of suggestions from people that don't claim to have disabilities. Perhaps few of them read hacker news? It seems that their needs would vary. One thing you could do is try to an interface to test it yourself. I tried to write and edit a document once using just voice commands. (Let's say someone has carpal tunnel and needs to use voice commands). It was eye opening. I reali…

> I tried to write and edit a document once using just voice commands. (Let's say someone has carpal tunnel and needs to use voice commands). It was eye opening. I realized how much more frustrating it is to go back and try to delete or fix something than anything else. And if the software didn't recognize an unusual word, it was really hard.

I've tried that as well. It was very frustrating. I used the Windows speech-to-text features.

Programming code is made to be typed and read. If you can't do either of those reliably, you'll be simulating that you can, which sort of by definition can't work well, because if you could simulate being able to write well, then you wouldn't even call that a disability, you'd just be different.

What I'm getting at is that the problem is simulation. Ideally, there would be a way to program by voice (or with a mouse, etc). Not program by typing code with voice, but find a way to describe a program (i.e. program) via voice. A voice-centric toolkit. I hope I'm not being too vague.

What we have now is such a typing-centric development world that we don't even think about all the other possiblities. Isn't the modern laptop just a really fancy version of a 100 year old typewriter?

I think Bret Victor would have a lot to say about this [0].

[0] http://worrydream.com/#!/TheFutureOfProgramming

Post reply on HN