4 ms·
Admittedly, I've never been big in C#, but I'm AMAZED by how much repetition string comparison there is. IE: Environment.GetResourceString("ArgumentOutOfRange_
by sekasi 12y ago
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?
- Rapzid 12y agoIt'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.