Overloading/Inheritance issue

Bill Baxter dnewsgroup at billbaxter.com
Sun Aug 5 15:24:14 PDT 2007


Walter Bright wrote:
> Bruno Medeiros wrote:
>> Walter Bright wrote:
>>>
>>> 4) Having overloads spread across the inheritance hierarchy makes the 
>>> source code resistant to visual audits. For any method call, you'll 
>>> have to look at EVERY base class to see if it has an overload that is 
>>> a better match.
>>>
>>
>> I'm not sure if you've seen my other reply to this argument, but let 
>> be more explicit, with pictures. Let's say you have such a big 
>> inheritance hierarchy, with overloads spread across it.
> 
> I appreciate that you can write tools to analyze it. I think they help a 
> lot in writing the code, but I don't think they are as helpful for 
> auditing (code review).
> 
> Another problem with them is they are not part of the D compiler itself, 
> and in my experience add on tools rarely get used, no matter how useful 
> they are.

It might be neat to define an API for the compiler.  I mean an api that 
would let you write programs that link to d-compiler.lib to do various 
things like get an AST etc.  I know D syntax tries to be easy to parse, 
but why not just have the spec also specify an api for would-be D 
compilers.  Giving a compiler a well defined API is not really something 
specific to D but it would make a lot of things easier.

--bb



More information about the Digitalmars-d mailing list