accessibilitycamelcasingpascalcasing

How to name symbols for blind programmers


How should I name the symbols I write in a way that they are read correctly by screen readers, so they do not create a barrier for blind programmers? By "symbols" I mean things like variables and function names.

For example, if I write a variable name as companyId, would it be read correctly? Or writing it as companyID would be better?

Opinionated answers between casing styles are not what I want. I just want a technical point of view if I should type HTTP over Http or Id over ID in order to help screen readers to spell it correctly.


Solution

  • I am a blind programmer. Almost all screen readers do specialMixedCapsProcessing. That is, every capital letter will be pronounced as a new word.

    One challenge that I face regarding identifier naming is that it can be tricky to spot two similar-sounding variables, particularly if the only difference is towards the end (when tired, my brain does pattern-recognition!). For example, numLinesInFile1/numLinesInFile2.

    A related observation is that the _ character is often spoken as "underline", which is 3 syllabuls. This makes it less efficient IMHO to work with codebases where underlines_are_used. Some blind programmers rename "underline" to "line", but I find that confusing.

    This is just one developer's opinion - other blind devs may have other ideas.