Order of Methods

For the most part, languages don't care about the order that methods are listed in a class definition. Here are some guidelines. List important topics first; think always of the reader (the human reader, that is) and try to make their job easier. Constructors are usually the most important topic, and hence are usually listed first. Put public features before private ones. Again, this is because it is the public features that are most important to the human reader. Break long lists into groups. For example, organize methods around high level abstractions, and group them accordingly. Within a group list items in alphabethical order. These are guidelines, and as such are not always applicable, but if you keep in mind the meta guideline of making it easy to read and find something, you won't go far wrong.

[audio] [real] Text to accompany slide23, in Chapter 4 of An Introduction to Object-Oriented Programming