Re: C# 3.0 Proposals
- From: "Mythran" <kip_potter@xxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 23 May 2006 11:06:37 -0700
"Demetri" <Demetri@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:3CB651CD-6B01-4CBD-922B-3CF0306236A5@xxxxxxxxxxxxxxxx
Where can I go to state my views for or against some of the C# 3.0 proposals?
They are listed here:
http://download.microsoft.com/download/5/8/6/5868081c-68aa-40de-9a45-a3803d8134b8/CSharp_3.0_Specification.doc
For one thing, I can not believe they are trying to convert C# to VB by
making it a non-type safe language. For an example of what I mean read this
excerpt from the doc:
"26.1 Implicitly typed local variables
In an implicitly typed local variable declaration, the type of the local
variable being declared is inferred from the expression used to initialize
the variable. When a local variable declaration specifies var as the type and
no type named var is in scope, the declaration is an implicitly typed local
variable declaration. For example:
var i = 5;
var s = "Hello";
var d = 1.0;
var numbers = new int[] {1, 2, 3};
var orders = new Dictionary<int,Order>();"
I don't know about you guys, but that just smells too much like VB's variant
type. NASTY!!
--
-Demetri
I see this mis-conception by a lot of developers. It is *NOT* an untyped variable (variant). Those are, in face, typed. For example:
var i = 5;
This creates i as an integer and assigns the integer 5 to it. If you later decide to assign a string, or other non-integral data to it, then you would get a type exception.
var i = 5;
i = "test"; <-- results in an exception being thrown because you can't assign a string to an integer.
If you read further about the language integrated query stuff, you should see that the "var" keyword is something that is needed for LIQ to function properly :)
HTH,
Mythran
.
- Prev by Date: Re: Transparant picturebox
- Next by Date: Re: C# 3.0 Proposals
- Previous by thread: How to read and write Hierarchical Configuration Settings
- Next by thread: Re: C# 3.0 Proposals
- Index(es):
Relevant Pages
|