Infosys Microsoft Alliance and Solutions blog

« Finding deserialization problems when using MSMQ with WCF | Main | MSMQ - Sending messages to remote private queues »

What's in a class/method name?

.NET framework 2.0 introduced a new feature called Anonymous methods via the delegate keyword. Some more details on this can be found in this MSDN Magazine article.

Working with anonymous methods can be a bit confusing and also make the code a bit difficult to read. Recently a colleague of mine, Vinay, however showed another interesting class and method naming convention.

public class _
{
    public _()
    {
    }

    public void __(string _, string __)
    {
    }
}

The above is perfectly legal C# code and will compile and build successfully. You can call the method in this class as

    _ _ = new _();
    _.__("_", "_");

So much for the class and method naming and cryptic code! Do note however that this code snippet will be a bit more readable with the VS2005 editor and its color coding.

TrackBack

TrackBack URL for this entry:
http://www.infosysblogs.com/microsoft-mt/mt-tb.fcgi/62

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)