3 ms·
You have gone wayy too meta for me to understand what you are saying. OP seems to make a claim that more functions hinder readability which is not true if you a
by gnufied 11y ago
You have gone wayy too meta for me to understand what you are saying. OP seems to make a claim that more functions hinder readability which is not true if you are using proper editor or IDEs, on other hand smaller functions enable unit testing and extensability which are pretty worthy goals if you are working on a project with multiple people.
- Dylan16807 11y agoIts good to keep functions from becoming huge. But when the article says that a function with 10 lines of code is too long and needs to be split up into a bunch of 3 line functions, that is a very extreme viewpoint. It's okay to flat-out reject such a viewpoint. It's not throwing the baby out with the bathwater. Let's say I tell you that you need to cap your car's speed at 15mph to save gas. Don't go around telling people that "well, if you control your driving you can save gas, let's not throw the baby out with the bathwater". Just tell people I'm being dumb and to ignore me. If the only thing true about a statement is such an extreme generalization that the generalization bears little resemblance to the original statement, just go ahead and reject the statement. (Note: It's okay to agree with the article's view, that functions should be extremely short. This is only advice for disagreeing. I'm sorry for making my analogy intentionally ridiculous.)