News for hackers. Stuff that matters.
Re:CoreCLR is now open source by sekasi on Tuesday February 03, 2015 @07:05PM (#8994459)
Admittedly, I've never been big in C#, but I'm AMAZED by how much repetition string comparison there is.

IE: Environment.GetResourceString("ArgumentOutOfRange_Index")

The string there is in multiple areas of that class, and the same behavior is displayed for all of them. Wouldn't logic suggest everything such as above would be moved in to a constant repository for clarity and also less potential human error for future additions?

Re:CoreCLR is now open source by Rapzid on Tuesday February 03, 2015 @08:06PM (#8994705)
It's pretty common in C# to use Constants to represent strings. Cuts down on the repetition as you said and you get the Intellisense too. I'd be curios to know the reasoning for using the literals as well.