Andrew Ducker (andrewducker) wrote,
Andrew Ducker

Things which annoy me in .Net #372

There were no generics in the first version. And all of the Windows Forms code was written then, and hasn't been updated to use generics.

So (for instance), despite all of the items in Listview.Items being of type ListviewItem they're returned as Object, because it implements IEnumerable, rather than IEnumerable.

So if I want to get a list of items from the listview I have to iterate around them all, casting them to the correct type rather than just using an AddRange. Admittedly, on an individual level this isn't much of a hardship, but it's still frustrating when you add up all of the times I have to do something like that.

I know that going back and updating all of the Windows Forms code to be generic compliant would be extra effort, but it seems like one of those things that would be worth it...

  • Interesting Links for 19-10-2021

    Lord Chancellor, there is already a mechanism for the law to be changed: it is called Parliament (tags: law uk fascism ) Dolphins living off…

  • Interesting Links for 18-10-2021

    Six things the UK could do to tackle climate change (tags: globalwarming uk ) Real Names: the wrong tool for the wrong problem (tags: names…

  • instagram cross-post

    Waiting for dance class to begin. Original is here on instagram. Original post on Dreamwidth - there are comments there.

  • Post a new comment


    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened