Sometimes (rarely), it seems that creating a function that takes a decent amount of parameters is the best route.  However, when I do, I feel like I'm often choosing the ordering of the parameters at random.  I usually go by "order of importance", with the most important parameter first.

Is there a better way to do this?  Is there a "best practice" way of ordering parameters that enhances clarity?

In general: use it.

Write a test for your function, a real world test.
Something you would actually like to do with that function.

And see in what order you did put those down.

Unless you already have (or know of) some functions that do something similar.
In that case: conform to what they do already, at least for the first arguments.

e.g. Do they all take a document/object/file-pointer/series-of-values/coordinates as the first argument(s)? For god's sake conform to those arguments.

Avoid confusing your coworkers and your future self.
