Skip to main content
Question Protected by gnat
Tweeted twitter.com/#!/StackProgrammer/status/192706130600927232
Source Link
Darth Egregious
  • 1.9k
  • 2
  • 13
  • 9

Are there guidelines on how many parameters a function should accept?

I've noticed a few functions I work with have 6 or more parameters, whereas in most libraries I use it is rare to find a function that takes more than 3.

Often a lot of these extra parameters are binary options to alter the function behaviour. I think that some of these umpteen-parametered functions should probably be refactored. Is there a guideline for what number is too many?