There seem to be many different ways of organizing methods in a class. I could group methods by access, and order them alphabetically. I could group related methods together. I could use a mix of the two, or something else entirely. Is there a standard way to approach this? If not, how do you approach it?
Share
StyleCop enforces some things here:
Furthermore, elements are ordered by access:
As well as a few other rules:
staticelements have to appear before instance elements.This might be a good baseline to start. As for additional ordering rules, I usually group related methods together.