2 ms·
Ugh. > Functions with about 16 parameters. I am reminded of a talk by Kevlin Henney [1]. He mentions this quote from Alan Perlis: "If you have a procedure wit
by shoo 12y ago
Ugh.
> Functions with about 16 parameters.
I am reminded of a talk by Kevlin Henney [1]. He mentions this quote from Alan Perlis: "If you have a procedure with ten parameters, you probably missed some." [2]. Kevlin goes on to give anecdotes about code he has encountered or heard stories about while consulting / teaching - the record was a function with around 370 parameters, and that function was still growing.
I'd prefer to see a function with a dozen arguments than a "function" that takes no arguments, returns void, and secretly communicates using global state. Explicit horror beats surprise horror.
[1] http://www.infoq.com/presentations/architecture-uncertainty-nordevcon-2014 http://www.infoq.com/presentations/architecture-uncertainty-...
[2] http://www.cs.yale.edu/homes/perlis-alan/quotes.html http://www.cs.yale.edu/homes/perlis-alan/quotes.html