new DIP47: Outlining member functions of aggregates

Gary Willoughby dev at nomad.so
Sun Sep 8 05:46:47 PDT 2013


On Saturday, 7 September 2013 at 17:00:08 UTC, Walter Bright 
wrote:
> 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'm absolutely against this DIP.

This proposal is just going back to the hell of header files 
again. Why on earth would you emulate C/C++ when D was supposed 
to be designed taking into account lessons learned from them. 
This is unnecessary complexity added for the sake of a few 
programmers who can't get out of C++ mode. I think you need to 
have a good hard think about *why* header files were introduced 
into those early languages and then consider if that reason is 
still valid. Personally i don't think it is. Java and C# do just 
fine without this.

Seriously, this goes against everything you learn as a 
programmer, nothing should ever be typed twice and then to say 
that the declaration and implementation could be different just 
boggles my mind?!?! Great more work!

If implemented, i will never used this feature and i will never 
deal with code that uses it either. I choose D *purely* because 
it didn't have this header file nonsense. If i find in future i 
start seeing more and more of this style of D code i would just 
move on to use something else that doesn't have all this extra 
baggage and work associated with it. Just because Manu brings it 
up randomly you decide to create a DIP?

In reality this is a documentation issue. Which has already been 
addressed by DDOC or *.di files. If data exists in one form, and 
it is needed in another, that's work a computer should do. Not a 
human! IDE's also give you numerous tools to get class overviews 
and such. If you are suggesting that you also need these class 
overviews in code to be viewed on github etc, just use comments. 
They are as arbitrary and simpler to implement.

Honestly this DIP is going backwards, i was under the impression 
D was going forwards! I am so disappointed.


More information about the Digitalmars-d mailing list