If you read through some of the clean code and refactoring books, the common solution to methods or functions that take a lot of parameters is to put all the parameters into a data structure and just pass that single data structure. That data structure can be a struct
, class
, an array, a hash table, a list, a tree, etc.
Also some of the programming books will note that a method or function that has a lot of parameters might be a code smell of breaking the single responsibility principle. It might be time to breakup that big method or function into smaller pieces which take smaller sets of parameters, and just chain the functions together.
As a side note, normally, methods that are not in scope are not shown by Intellisense (and most other IDE's that have some form of symbol documentation). You can potentially have one private method that is the version that takes many parameters, but have multiple public overloads of the method that take less parameters. Yes, this will against your requirement of not showing many methods, but in my opinion, there is less cognitive overload seeing a single method with many overloads versus seeing a single method with many parameters. If good overloads are picked, you have a high probability of passing the minimum parameters needed with just using Intellisense and filling in the blanks. Compare that to trying to call a method with a ton of parameters and you wondering "what is this parameter? is it required or optional?"