DEV Community

Discussion on: The most important ESLint rule: max-params

Collapse
 
loucyx profile image
Lou Cyx

Nice article! For me, unaries (functions that only take a single argument) are the way to go. Need more parameters? Use currying, tuples or objects depending on your needs. If you really think about it, functions with more than 1 argument are generally a nightmare because we have concerns such as:

  • Is the order of the arguments correct?
  • What happens if we need to change that order?
  • What happens if we need more arguments?

These problems are all resolved if we only use a single argument every time.

Cheers!