So there's this thing going around about how
is just a for-loop.
I mean, yes, sort of, but a sum is not a for-loop. For one, there's no requirement to sum the thing in a particular order, whereas a for-loop usually has a definite, procedural order defined. For-loops do a lot more things than what we usually want to express with Greek letters.
There's other ways in which the analogy breaks down.
If you get stuck with the thinking "it's a for loop", you might lose out on some interesting insights. Changing the order of summation often produces interesting results, such as telescoping series or the famous "Gaussian" anecdote on how to sum up the integers from 1 to 100.
But what I really don't get is the outright *animosity* that a lot of programmers feel, outright *anger* that mathematics is written with Greek letters now and then instead of code.
Whereas with code you can just type in the error message into a search engine and you'll get a Stack Overflow response soon. (Woe betide you if you're trying to look up symbols in a regex, though, search engines can't usually handle those.)
There are ways to figure out what symbols means, but programmers are used to just typing into a computer to get answers. That doesn't usually work with mathematics.
The way to know what symbols means are:
1) ask a human (mathematics is a social activity)
2) try something like detexify to at least get a common ASCII representation of the symbol
3) read around the text, maybe the symbol is defined earlier
4) read the references of the text, maybe something else in this field defines the symbol
5) try to guess from context what the symbol should mean (and sometimes authors just have typos and used the wrong symbol)
@JordiGH While I agree with you that the anger against mathematicians is unjustified, I disagree that summation is anything more than a specialized for loop.
Just because you can do clever (compile time) optimizations to your math doesn't suddenly make it something different.
Even when it's symbolic, it's not that different, since there are computer algebra systems that can deal with for loops and summation.
In the end, it's just notation, so this is in the realm of language.
@JordiGH I did a course once on NLP based on tree automata defined over a universal algebra. We used Greek letters all over the place and that was pretty much necessary. The equations and proofs that we derived would have been completely illegible and incomprehensible if it wasn't written densely. So yeah, turns out there's a reason for doing stuff that way.
@JordiGH The computer *should* know what the symbol means. I think it would be very hard to argue that mathematics is better off for being less accessible in this context.
@henryseg But is it less accessible? To whom? Every human understands for loops but not every human understands sums?
@JordiGH I agree that different communities use different notation, and if you’re in one of those communities already, things are more accessible if the notation matches what you’re used to.
But if you’re outside both communities, its much more likely that you have access to google than that you have access to a live expert who can tell you what the ungoogleable symbols mean.
@henryseg @JordiGH Are we really arguing here that the word "for" is more Googleable than a sigma symbol? If you already know what it is, you might think to search for the string "for loop" instead, but what if not? And if you're searching Wikipedia rather than Google, and can type or copy Σ you get an article whose second line describes the intended meaning, where the "loop" meaning of "for" is somewhat farther down on https://en.wikipedia.org/wiki/For
@11011110 @JordiGH I just tried googling “for programming” and the top hit is the Wikipedia page “for loop”. But yes, there are surely examples where programming terms are hard to find. Of course, the same is true for math terms. (People need to stop calling things “normal”…). But in general, I would claim that math notation is currently harder to search for because of all the fancy symbols.
@JordiGH i ran into this on a telegram channel! i flippantly mentioned that the difference is that the math version "is concurrent" and several junior coders got really butthurt about it
@JordiGH yeah as if a for loop is the most straightforward thing ever, with that “spell” in the brackets.
"the map is not the territory".
A for loop is a representation of the sum (a way to calculate it), not the mathematical reality.
The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!