Low dimensional matrices, vectors, quaternions and a cubic equation solver

Eric Poggel dnewsgroup at yage3d.net
Mon Apr 19 12:41:12 PDT 2010


On 4/16/2010 10:41 PM, Andrei Alexandrescu wrote:
> Generally I'd strongly suggest making operations free generic functions
> instead of members.

I disagree on this one.  It unnecessarily adds more names to an outer 
namespace and makes code less readable:

vec1.cross(vec2).project(vec3).length();

vs:

length(project(cross(vec1, vec2), vec3);

The first reads naturally while the second is more like polish notation 
and is easier to forget parentheses, as I did.



More information about the Digitalmars-d mailing list