I’d like to register a couple of problems with current
mod.rsends up lexicographically in the middle, but usually it is among the more important files because it presents a high-level API of the module. So this complicates code exploration a bit: you can’t instantly find mod.rs on github, for example: https://github.com/rust-lang/cargo/tree/master/src/cargo/ops. It’s interesting that Python’s
__init__.pynicely dodges the problem, because of the leading
__. Of course, if you use an IDE, it can color-code and move
mod.rsto the top (we’ve added this today), but you don’t always use an IDE.
@briansmith also listed a concern that having a gazillion of files named
mod.rsis inconvenient, because you can’t easily find the file by name. I personally don’t feel this particular problem, because any tool I use which can find files by names allows me to filter by parent directory as well. But at the same time we have special code in IntelliJ to include directory name in the name of the tab with
mod.rs, because plain
mod.rsis not very helpful.
And I think in theory we can add a new convention, like
foo/_foo.rs, in a backwards compatible way. I am not sure that it’s worth doing this though…