4 ms·
> It's not only JS/TS. Python, Go, Rust Rust allows you to move modules around without you changing using.
by metaltyphoon 1y ago
> It's not only JS/TS. Python, Go, Rust
Rust allows you to move modules around without you changing using.
- jeswin 1y agoWhen you write 'mod foo;' in a Rust file (say, main.rs), Rust will look for the source code for the module named foo in one of two places: a file named foo.rs in the same directory as the file declaring the module, or a folder named foo/ with a file named mod.rs inside it. That's great. Something like this is what C# can also aim for, while retaining full backward compatibility.
- metaltyphoon 1y agoThis would break every codebase in C# where a file lives in a folder where it is NOT in sync with the file system.
- jeswin 1y agoThis can be opt in, and not break any existing code.