Hacker News new | ask | show | jobs
by garmaine 2410 days ago
There is no function in the world that should ever take 17 parameters. If the algorithm permits such configuration, as I am sure it does, then it should take a configuration object which has all these values. The object could then be constructed using special purpose factories that take fewer parameters, and then customized from there as needed.

It may be an indication that the whole thing needs refactoring though.

1 comments

You refactor that way but then you make it unnecessarily more complicated.