c# - Constant abuse? -
I have run in a few bundles of code in some projects, which have the following constants:
const int ZERO_RECORDS = 0; Const int FIRST_ROW = 0; Const int DEFAULT_INDEX = 0; Const int STRINGS_ARE_EQUAL = 0;
Has anyone ever seen such a thing? Is there any way to use constants to represent language structures? IE: The first index of C # in array is on position 0. I think that if the developer needs to be constantly dependent to tell that the language is based 0, then there is a big problem in hand.
The most common use of these constants is in dealing with data tables or in 'for' loops.
Am I thinking that these codes are odor? I think these are not perfectly better:
const int zero = 0; Const String A = "A"; Abuse of IPHO "zero" is just one of the basics. While STRINGS_ARE_EQUAL might be easy, why not ".quals"?
Comments
Post a Comment