CodeSOD: A Generic Comment

This post was originally published on this site

The Daily WTF

To my mind, code comments are important to explain why the code what it does, not so much what it does. Ideally, the what is clear enough from the code that you don’t have to. Today, we have no code, but we have some comments.

Chris recently was reviewing some C# code from 2016, and found a little conversation in the comments, which may or may not explain whats or whys. Line numbers included for, ahem context.

4550: //A bit funky, but entirely understandable: Something that is a C# generic on the storage side gets 4551: //represented on the client side as an array. Why? A C# generic is rather specific, i.e., Java 4552: //doesn’t have, for example, a Generic List class. So we’re messing with arrays. No biggie.

Now, honestly, I’m more confused than I probably would have been just from the code. Presumably as we’re

To read the full article click on the 'post' link at the top.