3 ms·
When it's impossible to avoid ambiguity in the parameters, you can just chose a function name that makes the ordering explicit: copy_from_to(file from, fil
by kstenerud 7y ago
When it's impossible to avoid ambiguity in the parameters, you can just chose a function name that makes the ordering explicit:
copy_from_to(file from, file to)
- raxxorrax 7y agoI like this more than being forced to name parameters since that would be too verbose in many applications. But there is a danger that the label of a type becomes less generic. Vector3(...) VectorXYZ(...) The second variant could be weird depending on application. Still, I see some people argue that positional arguments should be forbidden in newer languages but I would disagree and my main argument would indeed be laziness.