Quite simply, a separation banner is used when you need to demark major blocks of a class or other source-file (assuming you aren't using Java) to aid in visual navigation and in keeping the class in order. The pattern I've seen the most is a line of slashes (i.e. enough to fill up to the 80 column), two slashes + text, and another line of slashes. E.g.
////////////////////////////////////////////////////////////////////////////// // IFoo Implementation //////////////////////////////////////////////////////////////////////////////Other examples for the text inside can be things like "Accessors" "Static Methods" or "Inner Classes".
Humorous Image brought to you by Digital Storytelling and The Simpsons |
So, next time you frequently get lost in the inner muckings of a class, consider adding some additional structure with a separation banner.
No comments:
Post a Comment