Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Convince me to move to .net 3.5 (from 2.0) [closed]

I am into new desktop app development. I feel at home with .NET 2.0 and c#. I guess I don't need linq, nor care for WPF and other Vista-oid fancy keywords. I also like rather tight and slim 2.0 redistributable, even more for reason it's Vista and 7 included.

Why switch to 3.5?

like image 403
Daniel Mošmondor Avatar asked Sep 01 '09 00:09

Daniel Mošmondor


People also ask

Is .NET framework 2.0 still supported?

. NET Framework 2.0 has been around for a decade but will be completely unsupported by Microsoft; the announced end of the extended support period is April 12, 2016. In lock-step with the . NET Framework, the corresponding version of Microsoft's development tool, Visual Studio 2005, is also at its end-of-life.

Is .NET 3.5 still supported?

For operating systems released prior to Windows 10 version 1809 and Windows Server 2019, . NET 3.5 SP1 remains a component of the Windows version on which it is installed. Future Windows releases will not affect the lifecycle of . NET 3.5 SP1.

Is .NET getting obsolete?

. NET 5.0 will reach end of support on May 10, 2022. After the . NET May updates, Microsoft will no longer provide servicing updates, including security fixes or technical support, for .


2 Answers

One word:

Linq

Once you've done a single query on your objects using Linq you'll never go back. Linq isn't just databases, you can have any kind of collection, and if you can express yourself functionally, you can change

foreach (obj in myCollection) {    if (obj.property == match)    {       foundObj = obj;       break;    } } 

to

myCollection.Single(obj => obj.property == match); 

EDIT: OR

var foundobj =  (from obj in myCollection where obj.property == match) .Single() 

Which one makes more sense? What about when you want to express much more complex queries like where this and that and that, from that select the ones that match some other property. You can do it in two function calls.

Sorry about the rant but I really do like Linq.

like image 196
Spence Avatar answered Oct 20 '22 10:10

Spence


Assumption: You're working with Visual Studio 2005 and .NET 2.0.

Reason #1: Vista includes .NET 3.0 as a part of the OS Install; Windows 7 includes .NET 3.5

Reason #2: There are ways to target .NET 2.0 using Visual Studio 2008 (and VS 2010) so you can gain from the productivity "goodies" of those tools without abandoning .NET 2.0, then move to .NET 2+ when you're ready. (Visual Studio can help you avoid non .NET 2.0 assemblies while you code.)

Reason #3: Extension methods, particularly the static class Enumerable. Technically, a part of Linq, but a good way to write code cleanly, clearly, and in a more maintainable way.

Reason #4: Bug fixes to the .NET 2.0 framework. Remember that .NET 3.0 and .NET 3.5 still use the same .NET 2.0 runtime under the hood - they just add new frameworks/libraries and some compiler tricks. There have been a ton of bug fixes to the runtime which you're missing out on.

like image 30
Bevan Avatar answered Oct 20 '22 09:10

Bevan