# Should we create a new constant or modify an existing one

I was fixing a bug in the code and it was something like this:

int const ROW_LOC = 1;
//....
Foo ( x , y , ROW_LOC ) ;


so it was passing that constant to a method ... and this ROW_LOC constant is being used in multiple other places in the code too.

For ONLY ONE place in the code because this constant was getting passed to some method that was working with a zero-based index I did like this:

SomeOtherFooMethd ( x , str , ROW_LOC -1 );


So my question is: Do I need to create a separate constant with value Zero for this one method call or you would continue using the same ROW_LOC and like I did just decremneting it by 1 in this case?

-

## locked by Jamal♦Aug 10 at 0:07

This question exists because it has historical significance, but it is not considered a good, on-topic question for this site, so please do not use it as evidence that you can ask similar questions here. This question and its answers are frozen and cannot be changed. More info: help center.

It depends on the meaning of this constant. If the value ROW_LOC - 1 has logical relation to ROW_LOC (e.g. it means that it should go right before ROW_LOC in some list) then just use ROW_LOC - 1 there, but if it's just 0 - then either define a new constant or just use 0 as value, depending on situation.
What I would suggest is to rename ROW_LOC to more meaningful (descriptive) name unless it's a well-known acronym in your company.