new DIP47: Outlining member functions of aggregates

bearophile bearophileHUGS at lycos.com
Tue Sep 10 06:49:20 PDT 2013


Walter Bright:

> Outlining of member functions is the practice of placing the 
> declaration of a member function in the struct/class/union, and 
> placing the definition of it at global scope in the module or 
> even in another module.
>
> http://wiki.dlang.org/DIP47

I was away and very busy, I have read only part of the answers in 
this thread.

I don't like this DIP. If this DIP passes I am probably not going 
to use this feature in my code.

Go and Python show that it's good to minimize the number of 
trivially different ways to write code in a language. This DIP 
does the opposite.


> or even in another module.

This is not a good idea.


> "If you rely on tools to make the code _readable_,

In my opinion this DIP makes the code less readable, and makes 
the code less DRY.


> 3. Parameter names need not match.

This seems bad. What's the rationale for this? (One perhaps 
acceptable solution is to put no parameter names in the signature 
inside the class).

Generally I suggest to fix the biggest module system bugs before 
modifying the design of related features, like the ones discussed 
in DIP47.

-----------------

Daniel Murphy:

> Let's solve a documentation issue with documentation 
> improvements.

This seems one better solution to the problem.

But I also suggest people here to read and discuss about the post 
written by Andrei that touches deeper issues. The module system 
is currently significantly buggy, and it needs a principled 
design before trying to add DIP47.

-----------------

Manu:

> People make claims like "write better code, split it up better,
> document your code better,

The D compiler could be modified a bit to generate a bare bones 
documentation even with not even a comment written in the code.

Bye,
bearophile


More information about the Digitalmars-d mailing list