Can obfuscated code be useful sometimes? : <p>While creating a custom 3D <code>Point</code> class with single-precision coordinate values in C#, I had to write a method to calculate the distance between two points. Then I thought about the <code>A -&gt; B</code> graph notation meaning "from A to B", and I thought about overloading the <code>&gt;</code> operator, as it has no sense thinking about a point A being "greater" than a point B (besides, the <code>-&gt;</code> operator cannot be overloaded).</p>

<p>So I created the following methods:</p>

<pre><code>/// &lt;summary&gt;
/// Calculates the Manhattan distance between the two points.
/// &lt;/summary&gt;
public static float operator&gt;(Point p1, Point p2)
{
    return Math.Abs(p1.X - p2.X) +
           Math.Abs(p1.Y - p2.Y) +
           Math.Abs(p1.Z - p2.Z);
}

/// &lt;summary&gt;
/// Calculates the euclidean distance between the two points.
/// &lt;/summary&gt;
public static double operator&gt;=(Point p1, Point p2)
{
    return Math.Sqrt(Math.Pow(p1.X - p2.X, 2) +
                     Math.Pow(p1.Y - p2.Y, 2) +
                     Math.Pow(p1.Z - p2.Z, 2));
}
</code></pre>

<p>This results in code like this:</p>

<pre><code>var manhattan = A &gt; B;
var euclidean = A &gt;= B;
</code></pre>

<p>The code seems to be obfuscated but once you get the grasp of it, it is quite simple to read, and shorter than using <code>A.DistanceTo(B)</code>. </p>

<p>The question is, should I completely avoid this kind of code? If so, what's the reason why? I am quite concerned with Clean Code, and I'm not sure this could be considered <em>clean</em> or not. If you think such code is sometimes allowed, could you provide examples?</p>
