Hello there,
I’m still fairly new to julia, but I guess it is anyway a general programming question.
In my code there are several physical parameters, e.g. mass,speed,height,… as well as numerical parameters for different numerical methods used subsequently, e.g. n1,n2,n3,…, and m1,m2,m3,… (In reality I give them more useful names).
Now I wrote a function which does the main calculation
function fun_unclear(mass,speed,height,n1,n2,n3,m1,m2,m3)
end
However, as there are so many arguments (around 15 or so by now), I wonder which way is the best practice to “cluster” them in smaller groups e.g. having
function fun_clear(phys_params,n_params,m_params)
mass = phys_params[1]
...
end
in order to have more readable/easier debuggable code. One way I can think of is to introduce some arrays
phys_params = [mass,speed,height,...]
before calling the function, but maybe there is another way which you recommend?
The parameters are all numbers, that is floats or integers.
Thank you for your input