Re: question on anonymous type
- From: Arne Vajhøj <arne@xxxxxxxxxx>
- Date: Sun, 08 Jun 2008 00:25:15 -0400
Jon Skeet [C# MVP] wrote:
Arne Vajhøj <arne@xxxxxxxxxx> wrote:I'm sure they'll survive - they just may not be as productive.I doubt it.
It has been discussed as a new feature for Java and it is nowhere
near the top of the popularity list.
That doesn't mean it won't prove to be useful in C#. People often underestimate how useful a feature will be when they haven't had it. Look up Blub's Paradox.
I don't think that apply very well. A rather big percentage of Java
programmers also program in C#.
I think it is the other way around.And I find it hard to believe that the usage of var instead ofIt changes the emphasis of the code. Eric Lippert puts it well:
explicit classname should take longer time to read.
http://csharpindepth.com/ViewNote.aspx?NoteID=61
X o = new X();
emphasizes the what and not the how.
First you read that you have an o of type X.
Then you may or may not read where you got it from.
var o = new X();
First you read that you have an o without more info and
then you has to read where it came from to figure out what
it is.
No, you're missing the point - with var, you tend to concentrate on what you *do* with o rather than the exact type of o (which is part of the "how").
But what I do with o.m() actually depends on what o is !
Arne
.
- Follow-Ups:
- Re: question on anonymous type
- From: Jon Skeet [C# MVP]
- Re: question on anonymous type
- References:
- question on anonymous type
- From: timor . super
- Re: question on anonymous type
- From: Arne Vajhøj
- Re: question on anonymous type
- From: Jon Skeet [C# MVP]
- Re: question on anonymous type
- From: Arne Vajhøj
- Re: question on anonymous type
- From: Jon Skeet [C# MVP]
- Re: question on anonymous type
- From: Arne Vajhøj
- Re: question on anonymous type
- From: Jon Skeet [C# MVP]
- Re: question on anonymous type
- From: Arne Vajhøj
- Re: question on anonymous type
- From: Jon Skeet [C# MVP]
- question on anonymous type
- Prev by Date: Re: Why does Math.Sqrt not take a decimal?
- Next by Date: Re: Thread fails to start when called from Server.Execute
- Previous by thread: Re: question on anonymous type
- Next by thread: Re: question on anonymous type
- Index(es):
Relevant Pages
|
Loading