Live data from Hacker News

Things in C# you might have missed

fekberg.com

11–12 of 12 posts

Re: Things in C# you might have missed

#11
This thread on Stack Overflow is useful if you want to broaden your C# skills by using features/idioms/techniques you may not yet even be aware of:

http://stackoverflow.com/questions/9033/hidden-features-of-c

The question is closed, but there are plenty of interesting answers.

One caveat: some idioms may seem really smart and/or terse, but others may have trouble understanding such code at at glance.

Re: Things in C# you might have missed

#12

Another neat tip, you can alias namespaces: using Super.Long.Namespace.Utilities Can be used as: using Utils = Super.Long.Namespace.Utilities Using C# since 2.0 and only learned about this a month ago!

This is one which had escaped me for years:

    private static bool GreaterThanOne(int @int)
    {
        return @int > 1;
    }
However, it would seem to me to fall into the "never, ever use this" category.
Post reply on HN