Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> In Rust, if I see a call to `foo::bar::baz()`, I instantly know that `foo/bar.rs` or `foo/bar/mod.rs`

In Rust, you would see `Bar::baz()` and have no clue where `Bar` is defined. The common style is `use something::somewhere::Bar`.



but if you see `Bar::baz` you can just go to the top of the file, and find the `use something::somewhere::Bar`, and then know what file `Bar` is defined in. In go, the import line only tells you what module/folder it is in, and you either need some tool or some intuition on how the module is organized into files to know what file to look for the definition in.


And then in Rust, that file ends up just saying `pub use ...`, and the real code is in a different module.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: