I am migrating a 1.1 winforms app to 2.0. what are the main things i should immediately change because of generics. Here what i have so far:
Any others that should be done immediately?
thks, ak
I don't think anything should be done immediately! The 1.1 code works, right? What's the business case for the wholesale swap to generics? Compile the app under 2.0, get it running and tested. And then, as new features are needed that would let you exploit generics well, implement those features as generics.
Any others that should be done immediately?
Generally, change any mention of IEnumerable
to IEnumerable<T>
, where possible. Migration can be greatly helped by switching the whole namespace, i.e. un-import
ing System.Collections
in every file and instead importing System.Collections.Generic
.
Also, search for mentions of object
and/or usage of boxing in your code and consider whether this is still appropriate or should be replaced by generics.
As jalf reminded me in the comments, another important change is the switch to the generic version of IComparable
where applicable.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With