-
Notifications
You must be signed in to change notification settings - Fork 888
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Style: Decide between foo.rs
and foo/mod.rs
#3883
Comments
I can no longer find my previous comment on this issue, but I'll try to pull it out again from my memory: There's nothing inherently wrong about either approach as long as they are used consistently across a codebase. For example, I use path searching (meaning searching for the path of a specific file) in both VSCode and Neovim, and so However, if you use a tree view in your IDE (I believe most VSCode users do), there's a high possibility that the tree view will put |
Hi @rami3l ! As for your concerns about IDEs, my view is that though the RustRover (which I am using) had been stabilized, there are also plenty of developers who are still using VSCode and Neovim, so I'll still lean towards |
@InfyniteHeap What is your experience with RustRover? Is the tree view aware that |
RustRover doesn't put As for the "path searching" that what you mentioned, I don't know whether RustRover supports this, because I haven't used RustRover for a long time yet. I use VSCode frequently on the contrary. Even though, I almost never used path searching in VSCode😂. So, I prefer using |
I have a strong preference for foo.rs |
I feel like stating this without any rationale isn't very helpful to the discussion. |
The picture just says that it's newer -- not that it's better... I think it ended up being not as good in practice as people thought when it was designed. I put some polls up on social media last night: These have so far gotten 113 responses, which is not a huge sample of course but also big enough to be meaningful IMO.
Not sure what to make of the split between Mastodon and Twitter results... |
I referred The Tao of Rust and found that this This example is adapted from the corresponding example came from The Tao of Rust. Assuming there have a file structure like this:
Now devs can obviously know the relationship bewtween That's one of the reason that what I guessed why Rust introduce the new method. |
Just to add a bit of personal experience: if the repo I'm dealing with has |
Problem you are trying to solve
Solution you'd like
Unify the style of source file organization across the codebase to either one of them, completely eliminating the trace of the other.
Notes
No response
The text was updated successfully, but these errors were encountered: