I find it easier to keep track of what I'm doing if I can see the entire function all at once. So here's how I prefer to write functions:
- Short enough to fit on my monitor with a reasonable font.
- If it needs to be longer than #1, short enough to print on a piece of paper in a reasonable font.
- If it needs to be longer than #2, short enough to print 2-up on a piece of paper.
I rarely write functions longer than that. Most of those are giant C/C++ switch statements.