So there's this thing going around about how
$\sum_{n=1}^4 2n$
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.

· · Web · · ·

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.

A lot of the anger stems from

1) not knowing what the Greek symbol means

2) not knowing how to look up what it means

3) not knowing the meaning changes with context

conclusion: mathematicians are just jerks who use Greek symbols just to feel superior and because they hate everyone else.

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)

I think these methods are utterly alien to programmers. Ask another person?!?! Usually you ask the computer or the docs! What the heck is detexify? Look for extra context to guess?? The computer should know what the symbol means! Ask the computer!

@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.

@urusan @JordiGH
> greek letters
its fine as long as you know that's what they are and once you learn how to decrypt what mathematicians write. it took me quite a while to figure this out because nobody would tell me until i found a tool that would identify symbols that you drew.

> changing the order of sums
for non-commutative things sure

> for loop
in a strictly C context but parallel systems have been breaking the assumption that for loops are sequential. ex. map-reduce.

@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 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.

@schappi I remember asking profs all the time what a symbol meant.

@JordiGH if you need a human to understand an educational text, the text is useless.

The whole point of a scientific paper is knowledge transfer, you may not have access to the prof sitting in an University on the other side of the globe.

Math notation is utterly broken as seemingly everybody just makes up their own convention.

That's like the "good" old days in Chemistry prior to IUPAC et al when everyone had their fancy symbols for (what they thought were) elements and reactions.

@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.

@JordiGH *braces

Isn't it a "map and territory" question there ?

@lienrag "Map and territory"? What do you mean?

"the map is not the territory".
A for loop is a representation of the sum (a way to calculate it), not the mathematical reality.

@lienrag Oh! Yeah, that sounds reasonable.

The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!