Community members respond with mix of agreement and skepticism
2 Yesterday 1:37 PM · 22h ago · 6 comments · 1 source · development 2 of 6
Lobsters commenters debate the essay's merits. Some agree that friction in function calls drives better API design; others argue the struct-based workaround adds boilerplate, that IDEs eliminate the friction argument, and that Rust could support named parameters without forcing optional arguments or overloading.
“After seeing the implications of making parameter names part of the public API, I don't think the complexity of expressing that is worth it.”
ancientheroitamarst Rust developer / authorSteve Klabnik Rust contributor (referenced)ekuber Rust team member
The whole story postscomments the bright band is this development · numbered dots are the others · click one to jump
What people said 6 voices · verbatim
-
What a nicely written article > friction produces better APIs Couldn’t agree more! I’m all for languages having a smaller set of features rather than being ever-growing
-
I used to be in the camp for keyword/optional arguments, but thinking about it more I've changed my mind completely. After seeing the implications of making parameter names part of the public API, I don't think the complexity of expressing that is worth it. Not to mention, the default values of optional arguments are also practically part of the…
-
"All of the above might be useful, though localized, syntax improvements. But the hidden tax is that the language becomes more complex, for arguably little gain." -- you can't seriously say this about Rust, a very complex language; the extra complexity isn't much compared to what's already in there. The gain is IMO very real - you get a nice API…
-
I broadly agree with this (especially considering the conclusion that thinking about restructuring the API is better than poorly emulating these features in the first place) although it somewhat feels like making excuses for "why this design you don't like and can demonstrably be done more conveniently is good actually". But like a lot of…
-
I tend to agree with this. Most of it applies to Go too, except for the part about default structs. It adds friction, but in a static language a little bit of friction can be good.
-
I don't follow. Why do you think this friction will lead to bad APIs?
All 6 developments of Rust dev argues structs beat named arguments for API design →
LobstersHacker News