Software contains many examples where a number of named items must be listed in a context where the order is not important. This is particularly prevalent in configuration files but is also found in code. One example I’m currently looking at is a set of WCF service host classes that need to be run in a service. The order they start is irrelevant as long as they are all started. As there are a number of types it’d be nice if I didn’t have to scan the list every time I wanted to see if something was included.
This is particularly a problem in large configuration files. Using search is an option but this is not always sufficient and fails for printed material. It is for this reason that I alphabetise these items unless ordering is significant. This simplifies the task of working with the items as it becomes predictable where they are located.
This is useful for configuration files and list items. I’d not recommend it for use in organising methods and other type members. These should be organised by their function, alphabetising would generally decrease the readability of the code.