Hidden Features of C#

An Unknown feature in C# Maybe Just For Me

It work this way;

Object a = otherObject ?? "otherObject is null";

It means otherObject will be assigned to "a" if it is not null. If it is null the object at right will be assigned to "a".

Its useful for me when I wanna set default values;

public class MyClass
{
private Object b;
public MyClass(Object a)
{
b = a ?? "Deafult Value";
}
}

Official documentation can also be found here; MSDN

Learning about Hidden Features

Eric Lippert's blog. The real guts of C# - why there are some limitations which might seem arbitrary at first sight, how design decisions are made, etc.

Alternatively, for more variety, look at the Visual C# Developer Center - there's a whole range of blogs and articles there.

Oh, and read the C# spec. No, I mean it - some bits can be hard to wade through (I'm looking at you, generic type inference!) but there's some very interesting stuff in there.

Will web applications replace desktop applications?

I've been asking this question for nearly a decade. In my business we build and sell both Windows and Web apps that do roughly the same thing. Four years ago I would have told you that we'd be 80-20 in favor of web apps by now. However, in terms of the numbers shipped, we are still about 60-40 in favor of the Windows apps.

While I once thought that the real barrier to the acceptance of software as a service was simply a desire for a better, richer user interface (which Silverlight, Air, etc. would solve), I'm now inclined to think that there are a lot of people who simply prefer a one-time purchase and local control over a web connected subscription model. Because this preference is rooted in personal perceptions of value for the money, I don't think that technology will change anything as quickly as we technologists think it will. Thus, I'd wager that Windows apps are with us for longer than we developers will ever expect; another 10 years at least.

Effective C# tips

We have a simialr questions :

Hidden Features of C#

Is there a site that emails out daily C# tips and tricks?



Related Topics



Leave a reply



Submit