News for hackers. Stuff that matters.
Re:Is there an excuse for short variable names? by Dove on Saturday February 02, 2013 @06:42PM (#5157849)
Variable name length should be inversely proportional to scope visibility. Names in complicated math should also be kept very short. I like to get the best of both worlds by renaming just before the formula:

    var G  = Physics.Gravitational_Constant;
    var M1 = Physics.Mass_of_Earth;
    var M2 = Simulation_Constants.Mass_of_Asteroid; 
    return (G * M1 * M2) / (r*r);

There are no comments on this comment yet.