CURL review request

dsimcha dsimcha at yahoo.com
Wed Aug 24 11:58:08 PDT 2011


== Quote from jdrewsen (jdrewsen at nospam.com)'s article
> One way that may improve this would be to move the static methods
> outside the class and make them into module functions instead.
> The drawbacks of this is:
> 1, When importing the module there would be more symbols polluting the
> namespace.

I don't consider this much of a problem.  If you want to use module that pollutes
the namespace a lot with rarely called functions that have short, common names,
that's what static or local (i.e. within a function/class/struct, which only can
be done since the last release of DMD) imports are for.  It's a problem in other
languages, but in D there are elegant solutions.

As an example, before I knew about static imports and before we had local imports,
std.file's propensity to collide with just about everything due to its use of
short, common names drove me crazy.  Now, I really don't mind because I always
import it either statically or locally.


More information about the Digitalmars-d mailing list