In looking at an indicator someone else wrote, there's this code:
In region variables: private bool showArrows;
In the logic to show arrows on the chart: if(ShowArrows) ...
In the area where the user can set the variable:
public bool ShowArrows
{
get { return showArrows; }
set { showArrows = value; }
}
I don't understand this: if the user is inputting to showArrows, how does ShowArrows ever get set? The input is to the lower case "showArrows", yet the logic uses the upper case "ShowArrows". Nowhere in the code is ShowArrows set to showArrows.
I see this sort of thing all the time and find it extremely puzzling. Why are there, nearly always, 2 variables used when all you want is one variable to use within the program?
Comment