3 ms·
Also I should point out that the variable names they use in these formulas are the worst possible, single letters, X, Y, some random greek numeral. If a program
by everyone 5y ago
Also I should point out that the variable names they use in these formulas are the worst possible, single letters, X, Y, some random greek numeral. If a programmer wrote variable names like that they would be fired.
- Jensson 5y agoI don't see how Function(Value) = Value + Value ^ 2 is any easier to read than f(x) = x + x^2. How would you write this function?
- Jtsummers 5y agoSometimes things have no particular meaning, or the meaning is related to the convention. In the other example you used, of drawing the curve, then x and y are perfectly fine names thanks to the convention (now long established) of using x and y to represent two orthogonal axes (generally the "horizontal" and "vertical", whatever that may mean in context). Using a more elaborate name would add no value. With respect to the use of Greek letters and such, I do lament that many writers of mathematics fail to define their terms. Instead assuming that the reader is fully conversant in the domain, when often a single paragraph at the start would add a great deal to the clarity of their work. However, that doesn't mean that the use of such variables is bad, they just need to be defined. The benefit of the mathematical notation is that it permits conciseness and lends itself well to symbolic manipulation (that is, a large portion of what we do when we do algebra and calculus). The former is a tricky subject, conciseness at the cost of clarity can be a net negative. But the latter is crucial to a lot of work, the way that we write programs does not lend itself well to symbolic manipulation and would be counterproductive for mathematics. In fact, I've often had to translate programs into a symbolic notation in order to try and decipher them because the long descriptive names, as useful as they are in isolation, ended up rendering the total procedure nearly impenetrable. Or at least unanalyzable. And the conversion to a symbolic notation permitted me to simplify the program substantially because I was able to apply ideas from algebra to the program (often boolean algebra, in particular, this is a very useful practice for condition heavy code with lots of predicates).
- h4x0r12345 5y agoThese are very childish and silly arguments. The letters have strong conventions in mathematics and definitely make sense when the functions are generic. It's like impulsively criticising Haskell or any other formal language for looking stupid and "worst possible" when you haven't put any effort whatsoever into learning it.
- jimsimmons 5y agoThings are subscripted and superscripted universally, without real use for either in most places. It’s just over loaded notation.
- PebblesRox 5y agoI wonder how much of the differences between mathematical and programming notation stem from mathematics traditionally being done by hand on paper vs. programming being typed on a computer.
- BeetleB 5y agoWhat would you replace for x and y? Mathematicians study equations in the abstract. x is just a real number. It's not distance, or time, or velocity. Would you rather they say "real_number" everywhere? And then what would you do when the formula has more than 1? "real_number1" vs "real_number2"? As to your original criticism, I'll wager that more people in this world will understand f(x) = 5x + 3x^2 than will understand rudimentary code, as it is taught a lot more than programming is. I don't mean anything negative when I say this, but the only people I know who complain about math syntax are programmers. By changing these conventions, you are asking all mathematicians, physicists, chemists, most engineers, economists, etc to change. I will wager that over 95% of them will not prefer your style. Finally, the trouble with replacing f(x) with Y is that the former tells me I'm dealing with a function. The latter does not. In fact, for many mathematicians, y = 5x + 3x^2 is a constraint, not a function.