![]() |
C# 3.0
Hi guys,
Long time no post, I was busy studying and working in the same time so I didn't have time to join the forums. But now I found some time to share my experience on C# 3.0 with C# developers here. Lately I started using new features which was introduced in C# 3.0 that are part of .NET Framework 3.5 and I was amazed by its features! I would like to know that if anybody here in the forums started using C# 3.0 yet? I'm expecting questions and/or discussion about this topic :) |
Re: C# 3.0
What features of C# 3.0 and .NET 3.5 have you been using ? I personally, haven't used any.
|
Re: C# 3.0
LINQ is pretty cool, but I haven't used it much. In terms of ASP.NET, 3.5 brought a bunch of stuff with it, especially related to AJAX.
|
Re: C# 3.0
Druid,
I started using anonymous types, extension methods, LINQ, new object initialization feature, lambda expressions instead of anonymous method delegate calls, the beautiful var keyword etc. If you want some code samples I will show you, or you can perform a simple google search and find tons of materials on the net. Jimbo, LINQ is awsome, I am using it against any object which implements IEnumerable<t> even if I have some legacy collections such as ArrayList I use LINQ against it using .OfType<T> operator to cast it to IEnumerable<T> object. |
Re: C# 3.0
>I would like to know that if anybody here in the forums started using C# 3.0 yet?
Yup. >the beautiful var keyword I get the sense that you're quite partial to this new feature. Would you mind explaining why? My impression is that implicitly typed variables are extremely easy to misuse and in many cases result in less transparent code. I suppose a more specific question would be what kind of guidelines are you using for when to implicitly type a variable and when to explicitly state the type? |
Re: C# 3.0
The var keyword is mandatory when you have an anonymous type and you go
:
And I also use it for stuff like declaring : :
Using var in this case is really a blessing :P In other cases I tend not to use it. But then again I haven't been doing too much 3.5 :) |
Re: C# 3.0
I take it one can only use 3.5 with MS Visual C# 2008?
:-/ |
Re: C# 3.0
I'm torn on the var syntax. On the one hand, it's weird in C# to declare a variable without explicitly declaring it's type. On the other hand, it's quite handy to use VB-ish syntax to give the variable a type without having to specify the type twice. Example:
:
// C# 2.0var foo = <some query returning who knows what type> so I can see why it can be controversial. |
Re: C# 3.0
Quote:
|
Re: C# 3.0
Thanks.
|
| All times are GMT -5. The time now is 4:21 AM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC