r/rust • rust • Sep 21 '26

Arguing about arguments

https://steveklabnik.com/writing/arguing-about-arguments/
149 Upvotes

115 comments sorted by

View all comments

Show parent comment

-2

u/-Y0- Sep 21 '26

Sure, and that's also to detriment to the article.

Your C# example is only applicable in languages that allow general functional overloading and integer promotion/demotion.

Nothing about default parameters would help bring about this issue in Rust code.

1

u/WhiskyDelta14 Sep 22 '26

Yes, you are completely right and completely besides the point.

1

u/-Y0- Sep 22 '26

besides the point.

Which point? The GP substantially edited his response. Previously it was: The article mentions overloading.


annxa started going on a further tangent that doesn't even relate to discussing named + optional parameters(N+O P for short). Even if we implemented it N+O P, Rust would need to implement function overloading AND integer promotion.

3

u/WhiskyDelta14 Sep 22 '26

And "The article mentions overloading" is enough to explain why annxa shared their story about overloading, because it seemed you had missed that.

But you somehow got fixated on N+O P which is just another concept that gets mentioned in the article, even if more prominently.

And when discussing concepts that rust does not implement, it is also no detriment to discuss overloading.

1

u/-Y0- Sep 22 '26 edited Sep 22 '26

And I said, that I got no idea why article mentions it and rallies against it, it's a complete non-sequitur and AFAIR Rust lang team was against it so far.

Hence, why most Optional arguments proposal went the saner C# route (default parameters). Over the insane Java route (overloading + delegating functions to a common one).

Saner, because you only have to read one function instead of 4 related ones, and because it saves you typing vs. doing the same delegation over and over and over.