Writing Code for the Next Person
Accessibility Considerations
In recent years, there has been an increased emphasis on accessibility. This includes everything from parking spaces to sidewalks to web sites. However, accessibility is often not considered by developers when choosing a coding style, yet it's important and should not be ignored.
Google and Mozilla are two companies whose coding style guidelines introduce certain accessibility challenges.
Part of the accessibility issues stem from the use of K&R, which as I noted in the previous section, introduce more challenges for people to locate the start and end of code blocks. I can hear those proponents now saying, "No, it doesn't!" It, indeed, does for some people who have certain visual impairments like hyperopia or presbyopia.
Another issue is indentation. Both Google and Mozilla specify the use of two-space indentations. Years ago, the industry standard used to be a tab character, which was defined to be eight character positions on a fixed-width display. As time progressed, the norm changed to four character positions. That is still the style used by Microsoft and probably most programmers today. However, Google and Mozilla decided to use two. This presents challenges for certain people, including visual impairment and dyslexia. The white space helps to create a visual separation, whereas two spaces can become almost invisible for some. It simply makes it harder for some people rapidly to identify code blocks.