I like to pass long parameter lists as associative array in PHP or as object literal in Javascript. Inside my function I have an array with default values. I then take the passed params array and overwrite the default values with the passed. This way I don't have to remember any order, I can leave out parameters that I dont want to pass/where I want to use the default values, and the array keys make the code more readable in the place where the function is called.
Example (Sorry, PHP):
function talk(array $params)
{
$defaults = [
'foo' => 'Hi,',
'bar' => 'my ',
'baz' => 'name is ',
'foobar' => 'Benni'
];
$eff_params = array_merge($defaults, $params);
return $eff_params['foo'] . $eff_params['bar'] . $eff_params['baz'] . $eff_params['foobar'];
}
Then call the function like this:
echo talk([
'foobar' => 'Ted',
'foo' => 'Hello '
]);
// Hello my name is Ted
BTW, JQuery uses this technique a lot, e.g. for it's $.ajax() function