Editing Hacks

Editing text (e.g., data files, program source code) can be a challenge for blind or visually-impaired programmers. Existing tools (e.g., one-line braille displays, screen readers) provide little assistance in dealing with white space, etc. This page discusses some of the problems and proposes ideas about leveraging software to work around them.


Most computer programs are composed of sequences of lines, separated by newline characters. Because text editors typically use monospace fonts, two-dimensional structure (e.g., vertical alignment) is easy for sighted programmers to create and recognize. So, white space (i.e., blanks, tabs, newlines) is commonly used to add visual structure.

For example, columns in a data file may be "lined up" vertically, to make them easy for a sighted reader to scan. The same technique is also used (in a more general fashion) by programmers. Here is a literal assignment expression, written in Ruby. The comments, keys, and values are all vertically aligned:

foo = {
  bar:   42,   # foo[:bar] is 42
  baz:   43    # foo[:baz] is 43

Indentation is typically used in source code to indicate hierarchies in control structure, modularity, etc:

Module Foo
  def bar(test)
    if (test)
      puts "Hi"

Although this sort of formatting is convenient for sighted programmers, it can be an annoying and time-consuming barrier for blind ones. Most obviously, they are required to traverse sequences of spaces and/or tabs. More subtly, in order to understand the intent of the formatting, they are required to compare columns in adjacent lines, recognize instances of vertical alignment, etc.

Tools such as VoiceOver "understand" table structures in web pages, to the extent that they allow the user to navigate rows and columns. However, they provide no assistance in recognizing or navigating the ad hoc 2D structures found in code or data files. Many text editors recognize and assist with indentation, but other forms of vertical alignment are generally ignored.

However, the blind programmer isn't free to ignore white space. In many languages (e.g., Elm, Haskell, Markdown, Python, YAML), indentation is a critical part of the syntax. So, getting it wrong may prevent the program from compiling or executing properly. In addition, sequences of spaces are commonly used to format output, etc.

And, if the blind programmer is working with sighted colleagues, she will be expected to follow their formatting practices. Although a prettyprinter can regularize indentation, it can't help with embedded spacing (and may actually damage it). All told, producing acceptable code could be quite a challenge.

Possible Hacks

It should be possible to hack up some prototypes, using assorted tools via the extension capabilities of text editors. Should any of the underlying approaches prove useful, the prototypes can be polished and strengthened for production use.

Edit Hacks - diff

This hack takes advantage of the Unix diff(1) command. Basically, the blind programmer works with a "minimized" version of the file, in which "unnecessary" spaces and tabs have been removed. When satisfied with the functionality of the file, she uses diff to display all of the editing changes. She then edits these into a "normal" version of the file, tests it, and submits it for distribution. See Edit Hacks - diff for more details.

Edit Hacks - view

A fancier hack would present the user with a minimized view of the file. Edits in either view would be mapped to the other, allowing the user to make edits in whichever view is more convenient. See Edit Hacks - view for more details.

Edit Hacks - meta

Going along with either of the approaches above, it would be nice to extract metadata from the file's text. Although the general problem of metadata extraction is AI-complete, a large subset can be handled by existing technology (e.g., parsing libraries). Pattern recognition can be used to direct this activity, detect and handle ad hoc formatting, etc. See Edit Hacks - meta for more details.

This wiki page is maintained by Rich Morin, an independent consultant specializing in software design, development, and documentation. Please feel free to email comments, inquiries, suggestions, etc!

Topic revision: r4 - 23 Jun 2016, RichMorin
This site is powered by Foswiki Copyright © by the contributing authors. All material on this wiki is the property of the contributing authors.
Foswiki version v2.1.6, Release Foswiki-2.1.6, Plugin API version 2.4
Ideas, requests, problems regarding CFCL Wiki? Send us email