4 ms·
An argument that usually lets programmers understand why physicsists do this: to a physicist variables like x (position), v (velocity), p (momentum), R (radius)
by jules 14y ago
An argument that usually lets programmers understand why physicsists do this: to a physicist variables like x (position), v (velocity), p (momentum), R (radius) are as clear as i,j,k,l to a programmer. Using the longhand would not improve readability for them, just like using arrayIndex instead of i would not improve readability for a programmer. In fact for a physicist it is much easier to read the short variable names, since that's what we always use, and it makes it easier to recognize an entire expression in the blink of an eye. It also keeps expressions on one line instead of 5. Another thing is if you're not a physicist, chances are very good you are not going to understand the code anyway, or at least not without consulting a physics text or paper, in which they will use exactly the same variables x,p,v,R, and now you're glad that these correspond exactly to your program's variables. If you update an equation like T = dE/dS to temperature = infinitesimal_change_in_energy / infinitesimal_change_in_entropy, you have gained only superficial readability. If you don't understand the former you will not truly understand the latter either.
- bane 14y ago> If you update an equation like T = dE/dS to temperature = infinitesimal_change_in_energy / infinitesimal_change_in_entropy and in the case the changes in energy or entropy are not so infinitesimal, the semantics of the variable name can cause all sorts of troubles