Talk:Ada Style Guide/Readability

Three thoughts for discussion referring to code readability.

1. I tend to use 'Ada.Text_Io'

Reason: many of my students have not been touch typists (I feel for them, neither am I). One of the common, and very frustrating errors beginners make is to type 'Ada.Text_I0' (i.e. "Ada.Text_" & Character'Pos(73) = 'I' & Character'Pos(48) = '0'). I found that if students used the lowercase 'oh' they could readily see that they hadn't typed 'nought'. It saved a lot of screaming frustration.

2. I tend to capitalize constant identifiers

Reason: looking at NUMBER_OF_ARRAY_ROWS I see immediately that it is a constant and not a function call. It does help the programmer (especially when going back to code months, or years, old). It is more help to the reader of a program, either for maintenance or marking. It is hard enough finding your way around student programs as it is. Anything which can make it easier is welcome.

3. I tend to add extensions like '_Pkg', '_Access' or '_Type' to appropriate identifiers

Reason: an extension of the concept of connotative identifiers. The more clearly I define the program entity the more readily I understand what the code is doing. Once again, I find this habit useful in maintenance or marking.