[Beowulf] Teaching Scientific Computation (looking fo the perfect text)

Geoff Jacobs gdjacobs at gmail.com
Wed Nov 21 20:11:09 PST 2007


David Mathog wrote:
<snip>
> Operator overloading reminds me of Bill Clinton's:
> "It depends what the meaning of 'is' is."  If operator
> overloading is used unwisely, so that the meaning of "+" is not just
> "addition of this type of data", then pity the poor schmuck who has to
> maintain the code.  Unfortunately you don't have to look far for
> data types where there is no single operator overload mapping that
> makes sense.  If A,B,C,D are 3D vectors then + has a single obvious
> meaning, but * is ambiguous, is it a dot product or a cross product?
> That's the point where C++ overloading breaks down, at least for me,
> and a function or #define is easier to work with, something like :
> 
>   A = B + CROSS_PRODUCT(C,D)
> 
While I love the C preprocessor, I wouldn't look that way for the Fount 
of Code Clarity.

-- 
Geoffrey D. Jacobs

To have no errors
   would be life without meaning
   No struggle, no joy



More information about the Beowulf mailing list