Idiomatic Use of the `Default` Trait?

80 points Purp1eGh0st 63 comments

I've started working at a company where use of the Default trait is ubiquitous, as I understand to perhaps be standard in Rust. However, I somehow always wince at this when forced to read the code. If I see something as simple as

let x = false;

I've immediately learned a lot about x: I know both its type, bool, and its value, false. In contrast, when I see

let x = Default::default();

I learn none of that. I know that it must be of some type which can be inferred by its later use, and its value must be whatever that type's default is. Within some complicated logic, this can make code harder for me to read and understand sequentially.

I went looking for something I could cite to coworkers to say "this is well-established bad practice" and came up empty, which surprised me. I think of Rustaceans as having strong opinions on what code is proper. So for lack of a better source I've written my own maximalist diatribe version of this here, but I'm curious about whether if I'm truly so isolated in this belief, perhaps I could just be misguided.

Does the community in general think of Default as something to be encouraged or discouraged? In what scenarios is it seen as idiomatic, and how do you avoid this sort of confusion?