Spatial Vector, Color Vector
<p>Say you have two things (spatial vector, color vector) that are conceptually different (pos in space vs color) yet they actually end up needing the same types of operations - overloaded plus, minus, scalar multiply.</p>

<p>A nice solution in the Cg programming language was they actually aliased member names .xyzw and .rgba.  So in Cg you can do</p>

<pre><code>float4 vector = float4( 4, 3, 2, 1 );

float red = vector.r ;
float x = vector.x ;
// both red and x will have the value 4.0.
</code></pre>

<p>So the question is:  How do you deal with things that are conceptually different but programmatically the same?  I could simply use a class Vector and "remember" that .x = .r, .y = .g and so on, which isn't that hard but appears somehow misleading.</p>

<p>The other option is to totally repeat the code in Vector and Color.</p>

<p>Which is better?  <em>Repeating code</em> for readability's sake, or <em>just living with the bad naming</em>?</p>
