![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Programmer
Join Date: Nov 2006
Location: Kosovė/Prishtinė
Posts: 47
Rep Power: 0
![]() |
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 ![]() |
|
|
|
|
|
#2 |
|
Programmer
Join Date: Mar 2006
Posts: 40
Rep Power: 0
![]() |
Re: C# 3.0
What features of C# 3.0 and .NET 3.5 have you been using ? I personally, haven't used any.
|
|
|
|
|
|
#3 |
|
Battle Programmer
Join Date: Feb 2006
Location: Bellevue, WA, USA
Posts: 754
Rep Power: 3
![]() |
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.
__________________
<insert disclaimer here> <insert shameless plug for Visual Studio here> |
|
|
|
|
|
#4 |
|
Programmer
Join Date: Nov 2006
Location: Kosovė/Prishtinė
Posts: 47
Rep Power: 0
![]() |
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. |
|
|
|
|
|
#5 |
|
Professional Programmer
![]() Join Date: Sep 2005
Posts: 419
Rep Power: 3
![]() |
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?
__________________
Even if the voices aren't real, they have some pretty good ideas. |
|
|
|
|
|
#6 |
|
Professional Programmer
|
Re: C# 3.0
The var keyword is mandatory when you have an anonymous type and you go
csharp Syntax (Toggle Plain Text)
And I also use it for stuff like declaring : csharp Syntax (Toggle Plain Text)
Using var in this case is really a blessing ![]() In other cases I tend not to use it. But then again I haven't been doing too much 3.5 ![]()
__________________
Don't take life too seriously, it's not permanent ! |
|
|
|
|
|
#7 |
|
Hobbyist Programmer
Join Date: Dec 2007
Location: Durban, South-Africa
Posts: 175
Rep Power: 1
![]() |
Re: C# 3.0
I take it one can only use 3.5 with MS Visual C# 2008?
![]()
__________________
The more the human race tries to change everything, when not needed, the less will they be able to change themselves when they need to. |
|
|
|
|
|
#8 |
|
Battle Programmer
Join Date: Feb 2006
Location: Bellevue, WA, USA
Posts: 754
Rep Power: 3
![]() |
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.0 Dictionary<String, String> foo = new Dictionary<String, String>(); // C# 3.0 var foo = new Dictionary<String, String>(); // VB Dim foo As New Dictionary(Of String, String) var foo = <some query returning who knows what type> so I can see why it can be controversial.
__________________
<insert disclaimer here> <insert shameless plug for Visual Studio here> |
|
|
|
|
|
#9 |
|
Professional Programmer
|
Re: C# 3.0
Pretty much so.
__________________
Don't take life too seriously, it's not permanent ! |
|
|
|
|
|
#10 |
|
Hobbyist Programmer
Join Date: Dec 2007
Location: Durban, South-Africa
Posts: 175
Rep Power: 1
![]() |
Re: C# 3.0
Thanks.
__________________
The more the human race tries to change everything, when not needed, the less will they be able to change themselves when they need to. |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|