Super-dee-duper D features (possible resolution?)

Pragma ericanderton at yahoo.removeme.com
Mon Feb 12 13:37:49 PST 2007


Sean Kelly wrote:
> kris wrote:
>>
>> Of course, the trick would be to find a reasonable tripping point 
>> where the abuse-potential starts to require some serious respect; like 
>> the vehicle noted above. However, it could be done; perhaps with a 
>> 'level'? I understand you're not crazy about switches and so on, but 
>> please consider it ... it could potentially be responsible for 
>> alleviating adoption fears. That's a pretty darned powerful switch.
> 
> I think this is a very good idea, and if some reasonable means of 
> implementing it could be found then it might actually aid D's adopting 
> in conservative circles without prohibiting powerful meta features from 
> being added.
> 
> What fuels my concern is that because the new mixin/import features are 
> so general, it is as easy to envision horrors rivaling the worst of C 
> macro code as it is to envision elegant and practical applications.  

It's funny you mention that.  Ever since the start, I've been trying to figure out how one could have an "obfuscated 
code contest" using D.  Until recently, it was only in the far corners of my imagination since you could only abuse 
operator overloads and identifier names.  For better or for worse, this just became a very real possibility - 
mixin("foo") evaluates recursively, right?

> I suppose this is why I've been kind of hoping an alternate solution would 
> present itself :-)  I think the general idea is fantastic, but these are 
> the first features in D that I might actually be inclined to prohibit in 
> certain development environments.  The potential for abuse undermines a 
> lot of what appeals to be about D: elegance, clarity, etc.  At the same 
> time, I'm excited about the direction in which things are progressing.

I agree with Sean and Kris on this - a goalie of some kind might be a nice attractor for project management.  However, I 
wonder if this is truly something that fits the role of the D compiler itself.  Isn't this more of a 
coding-policy-enforcement tool, akin to something that manages coding style, whitespace, etc?


-- 
- EricAnderton at yahoo



More information about the Digitalmars-d mailing list