this post was submitted on 22 Sep 2026
24 points (100.0% liked)
Rust
8294 readers
32 users here now
Welcome to the Rust community! This is a place to discuss about the Rust programming language.
Wormhole
Credits
- The icon is a modified version of the official rust logo (changing the colors to a gradient and black background)
founded 3 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Yeah, which especially becomes an issue in languages with poor mutability controls. Probably the most benign variant of argument defaults would be restricting them to being
const, or at the very least immutable including internal mutability. Instead we have situations like in Python where it's necessary for linters to warn people that setting[]or some other mutable data structure as a default is a bad idea (e.g. B006).Yeah, this is also something of a mixed bag, where
T, but it's used for different purposes,s/blacklist/blocklist/) because it would break clients is just a PITA.I wrote in another comment that I was partial to named arguments out of habit, but the more I think on it, I wonder if it's not mostly a tool to work around missing type information and bad APIs, which, uh, may not be the most desirable thing to add to Rust.