Clay language

bearophile bearophileHUGS at lycos.com
Tue Dec 28 00:19:52 PST 2010


Adam D. Ruppe:

> That's the ideal situation. Writing out qualified paths by default
> is just awful, and I can't understand why you keep asking for it.

Importing all names from a module on default is against modularity. While you read a module code you don't know where the imported names it uses come from. Take also a look at how Ada specifies interfaces across modules. A language needs to be designed with a balance between low verbosity and safety, here in my opinion D has chosen too much for the low verbosity (as Walter reminds D's anti-hijacking support in imports is a nice idea, but I think it's not enough).

(Reading about safer language subsets like SPARK and MISRA I have learnt that having a language safe on default is better (because this safety spreads in the whole ecosystem of the language users, and not just in a small subset of it), but where that's not possible, then sometimes an acceptable replacement is to have a language design that allows an external tool to statically disallow an unsafe coding style or feature (in many cases this is not possible for C, or it's possible but leads to a very limited language). In this case for an external tool it's easy to statically disallow not-static D imports.)

Bye,
bearophile


More information about the Digitalmars-d mailing list