Don Kiely's Technical Blatherings

All Things Technical in .NET, SQL Server, and Security

<July 2008>
SuMoTuWeThFrSa
293012345
6789101112
13141516171819
20212223242526
272829303112
3456789


Navigation

Personal

Subscriptions

News

Post Categories



Is C# Becomming VB?

I didn’t make it to PDC this year, but plenty of bloggers have posted plenty of information about what they’ve found most interesting.

The most amusing post that I’ve seen that doesn’t intend to be amusing is Ted Neward’s analysis of the new features coming in C# 3.0 that will arrive at some well-into-the-future date. It seems that C# is becoming VB, if not in syntax at least in features.

Check out implicitly-typed variables, in which you can do something like this (these are Ted’s examples):

var i = 5;
var s = "This is an implicitly typed local variable";
var a = new int[] { 1, 2, 3 };

(Note that a var is not a variant. The variables are strongly typed, it’s just that the compiler is figuring out the type.) So i becomes an Int32, s becomes a string, and a an Int32 array. Then check out object initializers, where the compiler will generate constructors for you. Anonymous types take this even further, where the compiler will be able to infer a type entirely.

While these features don’t function exactly like those in VB, it seems that the C# has a mandate to make C# a more productive language to program in, something that VB has working toward for years.

posted on Tuesday, October 04, 2005 6:44 PM by donkiely


# No it ain't VB !!!! @ Thursday, October 06, 2005 2:06 PM

In response to a post yesterday by Don Kiely, in which he quizzed if C# was becoming VB, and he does...

Anonymous




Powered by Dot Net Junkies, by Telligent Systems