2 ms·
I'm aware it's in the standard now, my point is that it's taken them a very long time to get to this state and what they do have isn't all that impressive. Conc
by mhh__ 5y ago
I'm aware it's in the standard now, my point is that it's taken them a very long time to get to this state and what they do have isn't all that impressive. Concepts have possibly taken my actual whole life although I don't know when the first proposal was.
That is a damp squib, of all the things I view as hacky in D that is not one of them.
Local imports are favoured for stylistic reasons anyway, they don't actually make all that much difference for code that isn't dead anyway. What's wrong with importing things where they are used?
IIRC Andrei proposed the local imports, but it was only a matter of removing an error message because they were banned at the time.
- pjmlp 5y agoNo matter how long C++ takes to adopt something, the language at least knows what it wants to be, and has an ecosystem to keep it going for decades that will outlive us. As for what is wrong with local imports, it makes impossible to track down module dependencies unless one goes grepping for imports all over the place.
- WalterBright 5y ago> As for what is wrong with local imports, it makes impossible to track down module dependencies unless one goes grepping for imports all over the place. Nobody is making anyone use them. It's a personal preference. As for "impossible", `import` is a keyword, so it's trivial to find them all using, yes, grep. D was designed to be more greppable than C/C++. For example, it's really hard to find all the cast expressions in C, but since `cast` is a keyword, it's trivial in D. (Cast expressions are all potential bugs, so being able to find them all in a code review is a good thing.)