public import and bugs it causes

Leandro Lucarella llucax at gmail.com
Fri May 14 13:38:16 PDT 2010


Nick Sabalausky, el 14 de mayo a las 15:56 me escribiste:
> "bearophile" <bearophileHUGS at lycos.com> wrote in message 
> news:hsk611$1utm$1 at digitalmars.com...
> > Nick Sabalausky:
> >
> >> // Vastly superior alternative to "import foolib.*;" which D
> >> // (fortunately) doesn't even have anyway.
> >> module foolib.all;
> >
> > What's vastly superior in it? Its unformalized nature?
> >
> 
> In Java circles, and probably some others too, "import foo.*;" is widely 
> considered bad practice. They have a number of reasons for avoiding its use. 
> I don't mean to avoid mentioning them, but I don't have much time ATM, I'm 
> sure you can easily google it though. But basically, there are known 
> problems with it, and those problems are mitigated by using the "import 
> foo.all;" idiom. 

Python have import foo.*; and you can controll it the same way you can in
D, except that if you don't do any fine control the default is to export
everything.

I think D is missing a feature here, not fixing or mitigating anything.

-- 
Leandro Lucarella (AKA luca)                     http://llucax.com.ar/
----------------------------------------------------------------------
GPG Key: 5F5A8D05 (F8CD F9A7 BF00 5431 4145  104C 949E BFB6 5F5A 8D05)
----------------------------------------------------------------------


More information about the Digitalmars-d mailing list