
Thorsten Ottosen wrote:
[...] but you would rather refactor into using named parameters?
If the code were used by people other than me, possibly so.
[...] I'm not insisting that you must refactor you N parameter function; I'm merely saying that chances are that it can be done and that it can improve the overall quality of your code. [...]
Of course it can be done. The question all boils down to whether it would improve the quality of the code. Consider the most common example that someone else gave: c'tors. Now, are you suggesting that types not have many data members, and should be decomposed until each type has, say, less than 5 members? If not, are you suggesting that we construct such types partially, and then fill in the rest later, so that we can avoid functions with many arguments? There are many cases where you simply have a lot of data coming from a lot of sources that need to go into one function, and encapsulating that data or refactoring the function is simply not appropriate or ideal. You must write magical code if you have never encountered such situations. Dave