I have a code that will check every 1000 of distance and make an action, the distance will never be negative, I will not know if it will be 0 or 4000 or bigger, is there any way to improve my code?
This is my class:
public class ComputeDistance
{
public double distance {get; private set; }
public Calculate Distance (double distance)
{
Distance = distance;
}
public Calculate Calc Distance ()
{
(Distance> = 0)
{
Do something();
}
else if (Distance> = 1000)
{
Do something();
}
() = ()
{
Do something();
}[...]
return this;
}
}
I would call it that way:
() () () () () ().
So far there is very little, but in the future it will be greater. If my distance is 20000, I already realize that it will go through quite if, that somehow hamper the performance? Yes, as I improve.