Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.



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




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: