CodeSOD: Double Narcissism

In mythology, Narcissus was so enraptured by his own beauty that he turned away all potential lovers until he came across a still pool of water. Upon spying his reflection, he fell in love and remained there for the rest of his life. After his death, a narcissus flower grew in his place- a daffodil or jonquil.

One important element of Narcissus's myth is that while yes, he was incredibly self-absorbed, he was also beautiful. That's less true for this C# code from frequent commenter Sole Purpose Of Visit. There is nothing beautiful about this code.

namespace Initrode.Extensions { public class PhbDouble { protected double m_Value; public PhbDouble(double avalue); public double Value { get; set; } public static PhbDouble Create(double avalue); } }

Now, it's easy to see that this is a useless wrapper class around a double. But what of that Phb on the front? Well this is anonymized, but in the original code, those were the developer's initials. Every class this developer wrote was tagged Phb. Every single one.

Sole Purpose Of Visit adds:

And no, there is/was no such thing as PhbInt or (rather sadly) a PhbBool.

The "signature" does, Sole assures us, "make it nice and easy to delete all his code".

Delete away.

[Advertisement] ProGet’s got you covered with security and access controls on your NuGet feeds. Learn more.

This post originally appeared on The Daily WTF.

Leave a Reply

Your email address will not be published. Required fields are marked *