class extensions

Lars Ivar Igesund larsivar at igesund.net
Thu Aug 30 01:01:35 PDT 2007


Alexander Panek wrote:

> Lars Ivar Igesund wrote:
>> [...]
>> It will also be directly detrimental to maintainability when used for
>> user defined types, as you no longer will be able to decide where a
>> function is implemented by only looking at the call site (given
>> inheritance and polymorphism this can in cases be difficult enough, but
>> at least you have a type hierarchy to look to).
> 
> Well, usually a simple change to the import list will reveal where each
> functions are defined. I wouldn't see that as an argument against this
> feature.

I probably miss your point here, but it certainly shouldn't be necessary to
change your code to find out what it does?

> 
> Apart from that, in an ideal world, the code is well documented enough
> to not have to determine the location of a function/method
> implementation yourself, anyways. Of course, this is the *ideal*, but
> maybe this encourages some to document better.

One should of course always document, but as many of the other suggestions
in the Future of D presentation leans towards self documenting code (pure
and nothrow functions for instance), I see this change as quite the
opposite in that regard.

-- 
Lars Ivar Igesund
blog at http://larsivi.net
DSource, #d.tango & #D: larsivi
Dancing the Tango



More information about the Digitalmars-d mailing list