Overloading/Inheritance issue
BCS
ao at pathlink.com
Sun Aug 5 14:53:52 PDT 2007
Reply to Walter,
> 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.
>
In code review, you may have a point. In writing code? Now that is one thing
Microsoft got RIGHT!! Visual Studio rocks in that regard.
Now it they just had a feature that (automatically without me asking for
it) gives me a list of cases where a code change resulted in a different
overload resolution... It would make a nice feature in a diff tool as well.
More information about the Digitalmars-d
mailing list