3 ms·
That is option A and B. I think the entire article is describing the down sides of that. You can't see if you a repeating the same stuff in multiple small thin
by pajtai 12y ago
That is option A and B. I think the entire article is describing the down sides of that.
You can't see if you a repeating the same stuff in multiple small things.
- javert 12y agoI guess this kind of got lost in my comment, but the point is that these functions are never called from anywhere else. You achieve that by not exposing them in header files.
- roghummal 12y agoIf they aren't called from anywhere else and they're only called once (in the parent), it might be better to inline them. Doing so goes against the urge to decompose as much as possible but it'd make the code easier to follow for the next guy. "What does do_small_thing_X do?" Even when the next guy is you, a year from now. Do you really remember what do_small_thing_X does?
- javert 12y agoYes, I do remember. If the function name isn't sufficient, you need a different decomposition of the problem. Another advantage of doing it my way is that you can put multiple comments inside those "small" functions if you need to. So you get two levels of decomposition. That really helps if your overall algorithm is broken into smaller parts that still need some explanation.
- otikik 12y ago> Do you really remember what do_small_thing_X does I don't need to wait a year, I forget what functions do the next day. So I try very hard to give them descriptive names. So I don't have to remember (and I just have to read).