4 ms·
What if foo() is present in two different libraries? (is this the 1% you're talking about?) What if tomorrow I add another library which implement his own foo(
by riquito 12y ago
What if foo() is present in two different libraries? (is this the 1% you're talking about?)
What if tomorrow I add another library which implement his own foo()? (this is trickier)
When I read the code, what is foo()? (here the IDE may be smart and show me the right documentation).
All that said, I feel that the pythonic "Explicit is better than implicit" is better.
It's also true that when I see a file whose first 30 lines are used for including dependencies it doesn't sound right.
The problem lies with the fact that we use text to store structured data. If we were to save source code as binaries we could have the source code in a "file|object|item" and the dependencies in another item, linked to the source code (I'm not advocating this, source code in text files has many advantages, but also his drawbacks).
- jamii 12y agoWe give each name a unique id under the hood. At edit time the user chooses which one they want from a list. The actual AST only ever refers to ids and the names are effectively just documentation. This has the neat side-effect that ids are globally unique so you can figure out what libraries you need to pull down just by looking up ids in your package repository.