Code spliting in module and packages

bearophile via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Jul 20 15:45:22 PDT 2014


Matthieu:

>Can someone explain to me how to do it well, please?

Put related stuff in a module, and unrelated stuff in other 
modules. If the module grows too much, split it up in two or 
more. It's about the same as in Python. Just remember that 
classes can see each other private members only if they are in 
the same module. So if you move things to another module, 
sometimes some stuff (like unittests) breaks.


> In the same time, is there someone who knows where to find a 
> good style guide for D, something like the PEP for python?

A starting point:
http://dlang.org/dstyle.html

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list