[BlindRUG] Are some naming convention more screen-reader friendly than others?

Henrik Bengtsson henrik.bengtsson at gmail.com
Wed May 10 18:54:25 UTC 2017


Hi.

as a non-screen reader user, I've got a question about coding style
and naming conventions for users of screen readers (possibly also
Braille readers).

In R there a few different naming conventions are used.  The classical
one uses lower-case letters with words separated by periods, e.g.
read.table().  Closely related to this one is the snake-case style,
where lower-case words are separated by underscores, e.g.
file_path_as_absolute().  BTW, the snake-case style was not possible
to do in R a decade ago, because underscore was a reserved symbol and
was not allowed in variable and function names.  This was a legacy
from S and may explain why the period was used so frequently.
A third common style in R is the camel-case style where the individual
words are identified by capitalizing the first letter (except for the
first word), and without a separator, e.g. readLines().

For legacy reasons, I'm a long-term follower of the camel-case style,
but I've been considering moving to the snake-case style for many
years now.  Knowing where one is better than the other for
screen-reader users may help me in this decision.  Maybe it's less
about one style versus another, but rather a matter of just using a
consistent style throughout, or?

My first question is, for R developers and R end users that rely on
screen readers, is there a preference to any of the above styles?  I
can imagine that a screen reader could have problems with camel-case
names when reading code, e.g. it tries to read them out as one long
unknown garbled word, or as an initialism, rather than separate words.
For instance, does screen reader help distinguish between the
following three cases:

  1. my.awesome.function()

  2. my_awesome_function()

  3. myAwesomeFunction()

Second, at the R prompt, is one style easier to use than the others?
Does it matter when using screen readers, or is the issue the same as
I, as a sighted user, have when I don't know the convention and I end
up using trial and error with some help from TAB completions?

Finally, does the naming style matter when programming in an editor?

Thanks,

Henrik




More information about the BlindRUG mailing list