3 ms·
rustfmt (currently in development) follows this principle.
by tatterdemalion 11y ago
rustfmt (currently in development) follows this principle.
- Animats 11y agoPlease don't make it an option. Use one format to rule them all, as with "gofmt". I don't care what it is, but pick something and standardize.
- madez 11y agoIt seems you are misunderstanding the situation because you are talking about not making “it” an option and you are then reiterating what I also said. Even if I repeat myself: I think there should be one default formatting that is standardized and there should be the option to emit in other formats such that everyone can read in the individually preferred format. With fmt you don't need to establish formatting rules on a project basis, anymore. Everybody can just configure their editor to format the code how they want it to look. That is why I think rustfmt should be compilable as a library, too.
- tatterdemalion 11y agoI'm not working on rustfmt but my understanding is that its output is going to be configurable. Every language carries with it a culture. The culture of Go is one which allows for gofmt to define one true style and refuse to deviate, just as it allows the language designers to refrain from adding generics. The culture of Rust is not like that, for several reasons. For one, the Rust community loves a good bikeshed. For two, the syntax of Rust is more complicated than Go, and includes situations (match statements & where clauses come to mind) in which people are just going to want to different things. I know the advantages of one true style - everyone's heard the arguments - and there's a sane, median default as the official style guide, which will be rustfmt's default output. That seems like a good compromise.