3 ms·
Say what you want, but it's better than how mathematicians choose names imho.
by amelius 6y ago
Say what you want, but it's better than how mathematicians choose names imho.
- uyt 6y agoIn defense of mathematicians, having conventional single letter variable makes stuff a lot easier to read. For example in graph algorithms, I used to write descriptive names like: weight = adjacenyMatrix[node][neighbor] Nowadays I write it as: w = G[u][v] Because in graph theory, an edge is usually (u, v), weight is usually w, graph is usually G, etc. It's basically the same reason why people don't name their indices "index" and instead use "i", "j", "k". And instead of point.first and point.second, you use point.x and point.y. Naming conventions are awesome when people can agree on them.
- patrick451 6y agoWhen writing code that is mathematical, I firmly believe "descriptive" names are an anti-pattern. To figure out what anything complex is doing, I'm going to have write the equations on paper anyway, and a matrix called G instead of adjecencyMatrix speeds that process along greatly. Even better, if the variable names are sufficient short and mathy, I may not need to translate back to paper, since the equations become more recognizable in place. This zealotry a lot of devs have over descriptive names needs boundaries.
- Asraelite 6y agoIn maths, you usually write "where x is ..., y is ... etc." after equations where what the symbols represent isn't abundantly obvious anyway. Likewise, when programming, if I reuse some variable very often in a short space, I will temporarily rename it to something single-lettered, e.g. "s = volumeScalingFactor; x = s; y = s; z *= s". I think maths style vs. programming style is only one factor here, with the other simply being this application of DRY: describe one-off things well, but shorten their names if they're oft-repeated within a given context. Maths tends to reuse the same variable for a lot of different operations in a single context whereas programming doesn't as much, which naturally leads to this single-letter name vs. long name difference in styles.
- krupan 6y agoThe single letters are pretty bad, but when we use a persons name instead of a concept to describe something is where it gets truly awful. What the heck is an Eigen vector? Gaussian curve? Cartesian coordinates? Hilbert space? Julia set? Mersenne prime? Zero chance of intuiting any of that
- marshallward 6y agoJust to quickly clarify: eigenvectors are not named after a person. It's a German word meaning "own" or "inherent" and was meant to denote something which resembled itself. https://hsm.stackexchange.com/questions/5563/where-does-the-name-eigenvalue-come-from https://hsm.stackexchange.com/questions/5563/where-does-the-... https://jeff560.tripod.com/e.html https://jeff560.tripod.com/e.html
- username90 6y agoMath needs way more names than English can support and since they are used by humans they lack namespaces. Human names are both easy for humans to speak and plentiful enough to satisfy the need for names in math, I don't see a better solution.