Live data from Hacker News

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

news.ycombinator.com

81–90 of 122 posts

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

#81
1. Do indentation right. One of the hardest things to do with a screen reader is indenting to a symbol. If we have a statement that doesn't fit on a line, it's much easier to increase the indentation by one level than to make the line start at the position where a symbol like ( is. The screen reader can tell you how many spaces of indentation you have, but figuring out where that symbol actually is and if it looks good is a real pain. This also applies to other situations where the exact number of whitespace matters like making struct declarations in c or go into a table, where one column is the name, one is the type and one is the comment, and spaces are used for alignment. If you really care about screen readers, I think tabs are a better idea for indentation, I feel they're a bit easier to use, though that may just be my preference. One language that got this horribly wrong is python, four space indentation and a lot of starting the next line exactly below a particular character on the previous one. A language that really got this right is go. They use tab indentation and they have that amazing tool called go fmt that basically does all the work for you. It basically formats your code in the standard go way. Yes, go aligns structs with spaces but I don't particularly care in that situation. I never use that convention in my code, I just run go fmt before committing and I'm sure everything looks right. In my opinion, alignment with spaces is the hardest thing to do when developing with a screen reader and it's really hard to avoid when your code convention requires it and you don't have a tool that does it for you. 2. Make error messages textual. A message like error at line 10(25), invalid syntax where 25 is the column is much easier to read than error at line 10, followed by the line with a ^ under the character in column 25. Another thing Python does wrong.

3. If you make a GUI framework, use native controls. Screen readers aren't magical pieces of software that do their things using arcane spells, to read anything, they actually need to get the information to read. To do this, they use operating system APIs. When an application uses native controls, it exposes all the needed information through those APIs and a screen reader can get it easily. If an application has it's own GUI toolkit, it's own representation of controls that doesn't correspond to the OS notions of a control and draws on the screen directly, the screen reader doesn't know anything at all. This is the case with i.e. GTK on windows. For a long time, this was also the case with Flash, Java and QT. 4. screen reader users generally prefer words over symbols (controversial, some might disagree). Symbols are nice for sighted users because they take less space on the screen and are faster to read, but for screen reader users they are not. Lua's "if a less than 1 then print quote this is a test quote end" reads much more naturally than go's "if a less than 1 left brace fmt dot print l n left paren quote this is a test quote right paren right brace". There's a reason why blind programmers like lua and ruby. 5. Very hard to do right, but one of the most annoying thing for me is to deal with various messages in the console. If it's a web table, you can do two columns, timestamp and message, and a blind user will know it's a table and be able to navigate only in the second column. If it's console output, you can separate them visually, sighted users will just glance over the timestamps but blind users actually need to hear them before hearing the message. Imagine you need to listen through "two tousant eighteen colon eleven colon zero nine seven colon fourty five colon three comma 7520, /cmd/frontend/main.go:19: server started" before each message instead of just "server started". That's the sad reality for most blind people dealing with logs and messages that contain long paths etc. I don't know if that can even be done right without hiding the info alltogether, as it's not possible for a blind person to navigate a table in the console, but this is something that should be taken into consideration.

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

#82
Perhaps instead, adapt a screenreader that understood C syntax, and instead of reading punctuation would read it in a higher level form, such as:

    for (int i; i 
instead of:

    "for left paren int i semicolon i lessthan 10 semicolon
    plusplus i right paren)"

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

#83
post #67

Just want to note that in Haskell, whitespace syntax _is_ syntactic sugar for brackets etc. I don't recall that being the case for python. Interesting tidbit, some of the big names in the Haskell community have very idiosyncratic coding styles that use the bracket look.

Can you point out an example or two the bracket style that I could take a look at? Thanks.

https://en.wikibooks.org/wiki/Haskell/Indentation#Explicit_c...

Probably the simplest good example, gives rules for translating between styles

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

#84

One thing which I think might be useful for speaking code is to try to avoid needing a mental stack or going backwards as you go through code (at least for English speakers. Maybe other languages are different). For example consider reading aloud: x = some_function(something_else(y), z) You first need to keep in mind “x =”, then “some_function”, then think about what something_else(y) means, remember about some_funct…

Yes, for me SQL is very hard to reason about just because of the way it's "phrased"

It's much easier for me to interpret JavaScript or PHP method chaining. I find myself struggling when I can't use an ORM.

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

#85
post #64

Earlier quoted context omitted.

Are Unicode characters a problem for the tools you use? For example, some languages will let you use λ instead of lambda. Or when trying to define the logistic function, I sometimes find myself writing σ(x) = 1.0 / (1.0 * exp(-x)) Or the Julia language has ≈, which tests if two floating point numbers are approximately equal. Visually, this is a reasonable symbol, it's not like one of the weird functional programming…

My screen reader, Orca under Linux, read those as "sigma" and "almost equal to." So I suppose those work, though I'd have to hit Google to find out how to type them. :)

In Julia editors these are written by e.g. typing `\sigma` with a backslash and using tab completion.

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

#86
Working with handicapped programmers with vision and hand issues I feel programming tools like Mu Pyhton and Blender were invaluable in giving the programmmer graphical feedback. Both Mu and Blender allowed interfacing with hardware in new ways. He is now a biomedical engineer at Medtronics designing physics models for medical devices. He started using Maya, Blender, Logo, Scratch, Python. He was trained at the NM Supercomputer Challenge in 3 Day events at New Mexico Tech in Matlab, Jupyter Notebooks, R Studio, AI and machine learning. He also build Raspberry Pi, Arduino projects after taking algebra in 4th grade and electronics at community college in 5th grade. Computers have allowed him to excel in almost every academic STEM area. He has had internships in bioiformatics and medical device analytics. His programming/electronics skills are not from the classroom but from multiple projects he developed.

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

#87
post #64

Earlier quoted context omitted.

Are Unicode characters a problem for the tools you use? For example, some languages will let you use λ instead of lambda. Or when trying to define the logistic function, I sometimes find myself writing σ(x) = 1.0 / (1.0 * exp(-x)) Or the Julia language has ≈, which tests if two floating point numbers are approximately equal. Visually, this is a reasonable symbol, it's not like one of the weird functional programming…

My screen reader, Orca under Linux, read those as "sigma" and "almost equal to." So I suppose those work, though I'd have to hit Google to find out how to type them. :)

Thanks for the response, that is pleasantly surprising default behavior.

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

#89

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…

Well it seems that OP needn’t bother as this problem is already solved. You wrote (loop (print (eval (read)))). How does that go with a screen reader? Like: Bracket loop bracket print bracket eval bracket read bracket bracket bracket bracket? The key thing I think is balancing and shifting parens. (loop (print (eval)) (read)) Is quite hard to sound different from (loop (print (eval (read)))) And more crucially what a…

”Bracket loop bracket print bracket…”

A screen reader need not literally read what’s on screen. It typically doesn’t with prose, where punctuation isn’t spoken, but affects timing and intonation, and abbreviations often are expanded (iOS speaks “Dr. John St.” as “Doctor John Street”, for example, but “St. John Dr.” as “Saint John dee-ar”. MacinTalk used to know that ‘Dr’ means ‘Drive’)

So, it need not do that here, and could say

“call read, eval it, print the result, and call loop on print’s output”

, using intonation or voice to indicate the difference between content read from the screen and text describing it.

Farfetched? Maybe, but take a look at what screen readers do with html.

A screen reader that knows lisp semantics could go even further, and replace loop by repeat forever or something like it.

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

#90
post #88

Just a random thought. Is there a programming language for dyslexics? Considering that dyslexia is a reading disorder, I suppose that the programming language can be really important.

Some languages help with misspellings by not just saying “‘foobra’ is not a function”, but also “but ‘foobar’ is. Did you mean to write that?”.

I guess you could also require the edit distance between identifiers to be at least X, but I expect that to be wildly impopular, if only because its effect on identifiers in libraries.

Post reply on HN