3 ms·
Usually, the formulas I derive on paper end up quite complicated and can not be simplified away. When I am numerically implementing the formula, I want that it
by jokteur 5y ago
Usually, the formulas I derive on paper end up quite complicated and can not be simplified away. When I am numerically implementing the formula, I want that it matches closely what I wrote in the paper, and long variable names would make my code less clear mathematically.
Why would I use the variable name "probability_distribution_on_m" instead of "rho_m", when I know all along what rho_m means in the contexte of my code (the symbol use throughout the paper). Usually, I comment at the beginning and specify what the variables mean and to what they correspond in the paper. And if somebody needs to read my code, that person will need to understand the paper first. More descriptive variable names won't make the person understand the paper better.
Of course, when I am writing some non-scientific software, I will use descriptive variable names, because there is no complicated formula, no paper that sets the context of the code, and it makes sense in general to have descriptive variables for logic elements for a clear code.
- yellowcake0 5y agoI didn't say to make your variable names verbose. rho_m is fine in my opinion, although I find it strange that you would name a probability distribution rho unless it's a density matrix. I would probably name it prob_dist_m, or even pdist_m if you want to be more terse. What I do think is bad form would be naming it ρ_m.