.NET Framework 4, in some ways, is “the” .NET. This is when .NET felt like a super solid platform that didn’t need anything else. It was great. Ironically, I don’t think .NET 4 added much over .NET 3.5, but it felt like a clean solution was fully brought together. It was released alongside Visual Studio 2010.
.NET Framework 4 did include some new features. First, it included support for dynamic objects. C#’s support for dynamics is something I haven’t used much. At Don’t Panic Labs, we haven’t had to use the dynamic support much. But the dynamic class does have value in creating interactions with libraries or systems with dynamic types. The ability to extend C# with the support of dynamic features provides some advantages.
The other significant feature of .NET Framework 4 was the addition of parallel programming support. This support came in the way of the Task Parallel Library.
The Task Parallel Library makes it very easy to make a single-threaded loop made into a parallel loop. The changes to your loops are incredibly minor, but you benefit from running your code across multiple threads of a modern multi-core system. Having many loops won’t actually benefit from parallel methods. But when they are useful, they are really useful.
I spent many years writing software using .NET Framework 4, so it has a special place in my heart. And even though .NET Framework 4 was solid, big changes were just around the corner.
.NET Framework 2.0 (Generics, Partial Classes, Nullable Types, Anonymous Methods)
.NET Framework 3.0/3.5 (WPF, WF, WCF, Auto-Implemented Properties)
.NET Framework 3.0 (LINQ)
.NET Framework 3.5 SP1 (ADO.NET Entity Framework)
.NET Framework 4.0 (Parallel, Dynamic)
.NET Framework 4.5 (Async)
.NET Core 2.1/2.2 (expression-bodied members, Local functions, Async Main)
.NET Core 3.0/3.1/Framework 4.7 (New Start, Performance, Switch Statements, Tuples, readonly, Using)
.NET Core 5 (Merge, Record Types, Top Level Statements)