|
|
|
|
|
by blago
536 days ago
|
|
> Proponents of small functions argue that you don't have to read more than the signature and name of a function to understand what it does; Although this is often the case, the style of the program can change things significantly. Here are a few, not so uncommon, examples where it starts to break down: 1. When you’re crafting algorithms, you might try to keep code blocks brief, but coming up with precise, descriptive names for each 50-line snippet can be hard. Especially if the average developer might not even fully understand the textbook chapter behind it. 2. At some point you have to build higher than "removeLastElementFromArray"-type of functions. You are not going to get very far skimming domain-specific function names if don’t have any background in that area. More examples exist, but these two illustrate the point. |
|