2 ms·
I don't see the value of, say, dot_product(vector1=x, vector2=y) compared to dot_product(x, y).
by xigoi 3y ago
I don't see the value of, say, dot_product(vector1=x, vector2=y) compared to dot_product(x, y).
- dragonwriter 3y ago> I don't see the value of, say, dot_product(vector1=x, vector2=y) compared to dot_product(x, y). I would include functions which implement (especially unary/binary) mathematical operators where the operands either are interchangeable or have a clear conventional order, in languages where you cannot make them actual operators, within the exception for operators.
- kstrauser 3y agoMy personal rule of thumb is 3-ish. More than that, and I switch from positional to named args. I appreciate how Python can let you insist on named-only args for when you want to remove the temptation to use a long list of positional args.
- Leherenn 3y ago2 parameters are usually fine, but then I have seen quite a few bugs with atan2(y,x).