3 ms·
I like the concept of making the 99% case as easy as possible and providing a failsafe when you encounter the 1% case, here an example. People usually complain
by davidkunz 5y ago
I like the concept of making the 99% case as easy as possible and providing a failsafe when you encounter the 1% case, here an example.
People usually complain about Nim's import behaviour which is roughly an `import *` in other languages, making it hard to immediately tell where things come from. Personally, I find it fantastic because it removes a lot of boilerplate. In case of conflicts, the compiler throws an error, forcing you to qualify your import.
Now in Rust, you explicitly need to import the trait in order to use it because there _might_ be naming conflicts. Here, the 1% case spoils the 99% case.
- tobz1000 5y agoI prefer the Rust/ES/Python etc. import syntax not because of ambiguity, but readability. Having everything traceable by quickly scanning the code, without IDE assistance, often speeds up my understanding of a file. And it becomes essential of you're reading code in an IDE-less environment, e.g. github gists. Worth the verbosity IMO.
- uncomputation 5y agoEach language picks its own trade-offs. I’m glad Rust errs on the side of caution for imports. Unlike most other languages, with Rust I know I can enter any file and know exactly and precisely what symbols resolve to. This not only simplifies things for me but fits my mental model of programming much better (deterministic, predictable, explicit).