3 ms·
> A lack of default arguments, a lack of basic arity overloading, a lack of variadic generics, all make me not want to write Rust. I'm not sure how serious thi
by zozbot234 5y ago
> A lack of default arguments, a lack of basic arity overloading, a lack of variadic generics, all make me not want to write Rust.
I'm not sure how serious this is, TBH? I mean, Rust does have macro syntax that supports all of these things (as seen e.g. in println!() and format!() ), and there are pretty solid engineering reasons to avoid those features within the basic workings of the language. I'm pretty sure most Rustaceans would argue that Rust is quite probably Doing the Right Thing here.
- ducaale 5y agoWhy do you think Rust not supporting variadic generics is the right thing?
- zozbot234 5y agoBecause Rust is not C++?
- ducaale 5y agoWouldn't variadic generics make working with tuples of any length easier[1], as const generics did for arrays? If that is the case, then I don't see how Rust not being C++ matters in this case. [1] https://docs.rs/tuple_list/latest/tuple_list/ https://docs.rs/tuple_list/latest/tuple_list/
- nyanpasu64 5y agoIn my experience, Rust's multiple named functions is usually (not always) more clear than multiple function overloads, and practically always better than constructor overloads (you'll never convince me that std::vector's constructors are sane). However (IIRC) I wish it was possible in Rust to abstract over arity, in the case of function forwarding and tuple overloading.
- tialaramex 5y agoI'd certainly like to be able to write std::cmp::max(a, b, c, d) and find the maximum of the four parameters. But even when I most want that, I certainly don't want it enough to use C++
- nyanpasu64 5y agoOh, another thing I forgot is that you need a crate and a macro to zip 3 or more iterators together.
- chakkepolja 5y agoOut of everything about rust those are weird reasons to nitpick about.