4 ms·
> Obviously, both of your extremes are totally unmaintainable and it doesn’t matter which somebody prefers of the two. But we work with 1000 five lines functio
by riffraff 4y ago
> Obviously, both of your extremes are totally unmaintainable and it doesn’t matter which somebody prefers of the two.
But we work with 1000 five lines functions all the time in high level languages.
All the stuff done on array/list/hash and the likes (map,fold/inject/reduce,sum,select,reject..) are five lines functions.
Why would you not want that for your own types?
- swatcoder 4y agoIf they’re operations used in a hundred places, then they should be whatever size they need to be. Of course there are a lot of 5-line functions in that set, and also some 500-lines functions and also many functions that recurse or stack very deeply, and also some very shallow ones. They’re polished stones. But function length isn’t a useful goal in itself and if it’s made to be, you’re deprioritizing the many other factors that matter.