I've been thinking about how some code I'm maintaining could have been written to make maintenance easier.
These ideas will be very familiar, even obvious, to most experienced programmers. They're not new ideas by any means. (I was a little mortified when I saw that 6 had read this before I added this disclaimer; I must have sounded rather conceited.
For example, if you have an array of some information about days of some month, in C, your array will begin with the 0th element. If all of your functions related to this array expect zero-based day numbers, it's likely that there will be many places where people will subtract one from a date that a user entered, or add one to a number returned from your array. It would be much less error-prone and simpler to use if your access functions did it -- or if element 0 of the array was unused.
I'm ambivalent about creating private member functions, though, because it often turns out that your code could be effectively used in other places too, outside the class you're working on at the moment. It creates a temptation to cut and paste.
Body of text last updated 1997-08-16. If you want my more-recent thoughts on programming (as well as other topics), you can subscribe to my thinking-out-loud mailing list. (This paragraph was added 1999-02-26.)