4 ms·
> Why is this a feature in every new language? Because superfluous type checker incantations are, aside from breaking up flow of thought when writing code, ann
by dragonwriter 3y ago
> Why is this a feature in every new language?
Because superfluous type checker incantations are, aside from breaking up flow of thought when writing code, annoying visual noise when reading it.
> I'd love it if named parameters were mandatory, not optional.
Named parameters are a different thing than type incantations, and I agree that it would be good for any non-operator function that takes more than 1 argument to require named parameters.
- xigoi 3y agoI 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).
- rstat1 3y ago>Because superfluous type checker incantations are, aside from breaking up flow of thought when writing code, annoying visual noise when reading it. I disagree. Implicit typing for the most part makes things harder read. The less I have guess about what type something is the better. I never use stuff like "var" or "auto", unless forced to for this very reason.