Module-based programming

Dicebot public at dicebot.lv
Fri Jul 26 05:13:30 PDT 2013


On Friday, 26 July 2013 at 09:12:27 UTC, Land wrote:
> struct Shader
> {
>      // Field
>      // Field
>      // Field
> }
>
> // Method
> // Method
> // Method
> // Method

I personally favor this approach whenever possible, it fits 
nicely with UFCS and allows to keep data type signature clean 
from unrelated stuff. My guideline is "If something simply 
operates on an aggregate, make it a free function. If it requires 
some knowledge about private aggregate state and/or is something 
done by aggregate, make it a method".


More information about the Digitalmars-d-learn mailing list