This is a "style" question.

Is there some defined custom for the order in which parameters are given to a function, or does it depend entirely on the programmer's stylistic preference? What if the developed software should be released to other programs to incorporate in their own programs? Obviously the parameters should be passed in some logical order.. Take the following two cases, for example:

[function] writeDataToFile (FileName, Data) {}
[function] writeDataToFile (Data, FileName) {}

Which one is preferred? Does it matter? I know the first example is the one which is typically used when passing a file name with data, but, if I, as a programmer [and an artist], were to use the second case, would I be an aberration?


11 Years
Discussion Span
Last Post by WaltP

I agree, it doesn't really matter on an individual basis.

The thing to keep in mind is the other functions in the system. How do they order similar function params.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.