11.11. Backward Compatibility

It should be clear by now that a great deal of the elegance offered by the .NET generics implementation was achieved through modifications to IL extensions. Of course, anytime you're talking about changing IL, you're also talking about changing the CLR and—more importantly—you're talking about giving up on any hope of backward compatibility. So, what does this mean in a practical sense? Well, if you're building solutions that must run with prior versions of the CLR, you won't be able to take advantage of generics. Any code you deploy with generics is going to require version 2.0 of the .NET Framework.

For most, this lack of backward compatibility will not be a significant issue. However, for some environments, it may pose a temporary migration problem. In the grand scheme, though, any hit that generics may impose on backward compatibility is well worth some interim pain. The truth is, the generics examples you've seen in this chapter—with all their optimizations and general efficiencies—would not have been achievable without introducing changes at the IL level.

Get Professional .NET 2.0 Generics now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.