'partial' keyword in C# is very good for project , what's the same thing in D?

Regan Heath via Digitalmars-d digitalmars-d at puremagic.com
Mon Nov 10 02:21:33 PST 2014


On Fri, 31 Oct 2014 09:30:25 -0000, Dejan Lekic <dejan.lekic at gmail.com>  
wrote:
> In D apps I work on I prefer all my classes in a single module, as is  
> common "D way", or shall I call it "modular way"?

Sure, but that's not the point of partial.  It's almost never used by the  
programmer directly, and when it is used you almost never need to look at  
the generated partial class code as "it just works".  So, you effectively  
get what you "prefer" but you also get clean separation between generated  
and user code, which is very important if the generated code needs to be  
re-generated and it also means the user code stays simpler, cleaner and  
easier to work with.

Basically it's just a good idea(TM).  Unfortunately as many have said,  
it's not something D2.0 is likely to see.  String mixins aren't the nicest  
thing to use, but at least they can achieve the same/similar thing.

R

-- 
Using Opera's revolutionary email client: http://www.opera.com/mail/


More information about the Digitalmars-d mailing list