I have a theory ...
... that methods come in two flavours.
The first flavour is simple. For example, methods like runMessages() consist of an iteration that runs each message. Heck, they might even send run() to each element in a list, but they don't do much else. They are trivial to understand and easy to see working.
Then there are the complex kind. These are the hairy long methods that do interesting work. They might be inlined, access the representation directly and have a ton of local variables and switches. These methods need to be decoded each time you see them.
The assertion is this: If your code is all simple, then control is too decentralized and your program might be large and slow, making it difficult for others to understand, maintain and debug. If your code is all complex, then control is too centralized and your code is a mess, making it difficult for others to understand, maintain and debug.
A good program has the right mix of both.
Steve
The first flavour is simple. For example, methods like runMessages() consist of an iteration that runs each message. Heck, they might even send run() to each element in a list, but they don't do much else. They are trivial to understand and easy to see working.
Then there are the complex kind. These are the hairy long methods that do interesting work. They might be inlined, access the representation directly and have a ton of local variables and switches. These methods need to be decoded each time you see them.
The assertion is this: If your code is all simple, then control is too decentralized and your program might be large and slow, making it difficult for others to understand, maintain and debug. If your code is all complex, then control is too centralized and your code is a mess, making it difficult for others to understand, maintain and debug.
A good program has the right mix of both.
Steve