He talks about breaking down functions to very small sizes, which makes a lot of sense as he describes it...
i downloaded the book. well, practically he's quite right. you loosely define what is "small" and showing 20 lines of code... 20 lines is "small", its relative to anybody you talking to. but when it comes to hundreds or thousands of lines, then i agree with him, regardless if it is "one function only" or "many small functions combined". let me add to him, he said...
The first rule of functions is that they should be small.
i say...
The first rule of code file is that they should be small.
how small? its relative though based on personal taste, for a function, it should be around 20 lines average, but for a file, maybe around few hundreds or few thousands lines? before it can easily out of control. otoh, with commenting and line breaking, one can increase the size meaning of what is "small".
edit: btw, coding thousands of lines in one single function is a very very old practice when no subroutine other than "main" existed. i'm yet to see any such code from the beginning of my programming life. and i never practice it myself, when it gets too big, it will get splitted... naturally. the greatest rule imho is.. use your own flavours and senses to define what is "big" or "small"
I'm not in a position where I want to defend one point of view from the other. I've come from largely coding in C in what would be classed as a fairly "traditional" approach, exactly what you're describing above. That you just break up functions where reuse is required, and where it just makes sense because they're becoming unwieldy or functionality isn’t related.
In my quest to expand my knowledge and become a better programmer, I want to give his methodology a go. Whilst he doesn't talk much about specific function sizes (i.e. lines of code), he describes it in terms of a function should do one thing only, which will be described by the title of that function, and will be only at one level of abstraction.
He then goes on to show many examples, generally in the 5-20 line size.
In a later chapter he also talks about size of source files, which he defines a target size of maybe around 200-500 lines.
But, as I was talking about earlier, I know this is contentious issue for programmers. I've been in a professional software testing course where the presenter was openly bagging Java developers for their very long function names being too similar and ever expanding number of classes. Then he went on to talk over some Ruby code that I thought was an absolute abomination of a mess.
It’s all relative, but I just wanted to understand from an embedded context where cpu cycles, and more importantly for me with current processors, Flash memory size, is a precious commodity. Are there going to be any penalties for this style of coding.