new DIP47: Outlining member functions of aggregates

Paolo Invernizzi paolo.invernizzi at gmail.com
Sun Sep 8 01:39:30 PDT 2013


On Sunday, 8 September 2013 at 06:47:14 UTC, Walter Bright wrote:
> On 9/7/2013 11:08 PM, Peter Williams wrote:
>> In summary, you've gotten rid of the need for this type of 
>> duplication so why
>> would you introduce it?
>
> I believe that is covered in the "Rationale" section of the dip.

IMHO the rationale of the proposal il pretty weak:

- You can't have a 1:1 correspondence with translated C++ code, 
so the translation barrier can be lower.
- You can't read _easily_ the code.

The first is not a problem, if it is true that D avoidance of 
duplication is better than C++ way of doing that stuff (and 
that's a C++ problem, as Peter suggested).
I would also add that I don't think at all that this is a 
concrete translation barrier: usually I start copying and pasting 
the C++ header in the D code, and then filling the methods 
translating from the cpp part one after another.

The second point is more subtle, as we are talking about an easy 
_navigation_ in the code in the editor, we are talking about 
being able to "gain a sense of familiarity" with foreign code?

The former is something that should not impact over the language 
at all (alas, C++ navigation, back and forth between header and 
implementation is a mess),

The latter resolved by D with DDOC, which it is perfectible BUT 
is _today_ a wonderful tool for strangers: the D library section 
on DLang site is there to prove it. You have at a glance all the 
definitions, documented and in sync with the last compilation. 
What is missing from that?

- Paolo Invernizzi


More information about the Digitalmars-d mailing list