Published on InterSystems Developer Community (https://community.intersystems.com)

Home > How Many Parameters Should a Good Method Have?

Discussion
Evgeny Shvarov · May 1, 2019

How Many Parameters Should a Good Method Have?

Hi Community!

Sometimes I meet a method which accepts 10+ parameters.

And often I need only the 8th parameter  to  pass. And I call the method something like:

do ##class(Some.Feature).Method(,,,,,,,"flag")

And I don't like this method when I call it like this cause, you know, often I just miss the number of commas and raise some other flag I wanted.

How do you avoid this situations? 

If you meet such a code, how do you call it and sure that you didn't miss the number of ","?

What is a good number of parameters in a method and f you need to pass more parameters in a method what do you do?

#Coding Guidelines #ObjectScript #Caché #InterSystems IRIS

Source URL:https://community.intersystems.com/post/how-many-parameters-should-good-method-have