8 ms·
I don't think descriptive variable names would be useful in math. The thing in math is that "x" you see can be repeated 20 times in a set of equations. Having t
by hackinthebochs 14y ago
I don't think descriptive variable names would be useful in math. The thing in math is that "x" you see can be repeated 20 times in a set of equations. Having to read "running_total" 20 times instead is a hindrance here rather than a benefit.
The difference between math and code is the number of variables. A piece of code can have an order of magnitude more variables than a set of math equations. But in math, a few variables will usually be repeated many times. You're simply optimizing different usage profiles.
So the benefit in descriptive names in code is being able to distinguish easily the many different variables. The benefit in single letter variable names in math is that you're able to write the information in a more compact, digestible manner.
The reason this latter point is important is for the same reason short, compact programming languages are a boon to comprehension. The faster you can read a set of related items, the more of it is in your working memory at any given time and thus the better you're able to understand it. I fully believe the time it takes to input a chunk of information through your visual system is inversely related to one's understanding of it. To put it another way, working memory's decay function is parameterized by time.
- slowpoke 14y ago>The benefit in single letter variable names in math is that you're able to write the information in a more compact, digestible manner. You missed my point entirely. I said that you should not optimize for writing math, you should optimize for reading math. And that's where the same argument as for code holds true as well: It doesn't matter if it takes longer to write, it will be read magnitudes more often, and that is what matters most. Again, if you're just doing quick calculations on paper or hacking something into your shell/REPL, I really don't care if you use cryptic variable names. I do, too. But I don't want to ever see this in a good program, and I think that it doesn't belong into a good math text, either. >The reason this latter point is important is for the same reason short, compact programming languages are a boon to comprehension. And again you missed what I explicitly stated: it's good to write in a concise way, but only as long as it doesn't become cryptic. And I disagree with your belief about information processing. It's better to build semantic relations by having meaningful names than it is to process a lot of information in a short time. It really doesn't matter how fast you are able read something - if it doesn't make sense, you won't understand it.
- hackinthebochs 14y ago>You missed my point entirely. I said that you should not optimize for writing math, you should optimize for reading math. My point is that these goals are nearly one in the same when you get to the high level. Many mathematical relationships are very complex, usually not the step-by-step procedures that is common in code. Thus being able to hold the entire relationship in your head at once is crucial. Single letter names for variables and functions are critical here (for the previously mentioned reason working-memory-decay). I basically have a bachelors in math, and I could not imagine reading complex equations with full variable names. The hard part is understanding the whole, not remembering what x or i means. If you find an equation cryptic, that just means you don't have the requisite knowledge to really understand it.
- slowpoke 14y agoSorry, if all you have left is the (very typical) argument of "if you think that way you just don't understand it", then I'll consider this discussion over. I have no interest in hearing endless appeals to tradition. I'm sure people made similar arguments for GOTO back in the day. Good thing we moved on.
- hackinthebochs 14y agoI would like to think my argument is far more nuanced than you're giving it credit. This isn't an appeal to tradition; I'm making an argument that explains why traditionally math has stayed with the "cryptic" notation rather than descriptive variable names. You're completely ignoring the working memory argument I'm making. A large part of math is pattern matching: recognizing a common relationship between variables (a common pattern or "theme") and investigating that relationship further. This ability is critical to mathematical ability. Visual compactness is crucial here. Using descriptive names will completely bog down your visual system with reading words rather than identifying patterns. Pattern matching is a critical skill when one becomes an expert in any field; in math its of utmost importance. Math is optimized for reading by other experts who have those same visual patterns committed to memory. This is the optimal approach for the work's target audience. Yes, it makes advanced math largely inaccessible to outsiders, but that's a part of the trade off.