|
Seven plus or minus two I learned about the "Seven plus or minus two rule" in a computer science class at Dartmouth College more than 20 years ago. I never knew the original source for this rule, though, until today, when I found it here (via Sam Ruby).
If, by the way, you're not familiar with the seven plus or minus two rule, it states that, for most people, the limit on the number of "chunks" of information that can be processed simultaneously lies somewhere between five and nine. It's more of an observation than a rule, of course, but it proves to be a handy guideline for lots of things. E.g., keep the size of your workgroups somewhere between five and nine contributors, present no more than seven choices on a menu or submenu in a UI, use no more than seven cases in a switch statement, etc. Of course there are legitimate exceptions to just about every application of the rule, but it is almost always useful to at least give some thought to whether or not an exception is called for. For example, if you see a block of seven or more consecutive lines of code inside an if/else or loop construct such that every line operates on the same piece of data, you may take that as a clue that it would be worth turning those lines of code into a separate function; or if you see a function that contains more than seven large comment blocks explaining what the code is going to do next, that it might consider whether that function should be restructured or broken up into smaller functions.
|