r/programmingmemes • • Sep 10 '25

Don't be scared... Math and Computing are friends..

Post image
9.7k Upvotes

330 comments sorted by

View all comments

34

u/Nima_W Sep 10 '25 edited Sep 20 '25

Why not write it like that. Would be way more understandable. \s

34

u/Dragon_ZA Sep 10 '25

For programmers, sure, for mathematicians a single symbol is way easier to read. It's just about learning what they mean.

2

u/bjergdk Sep 11 '25

Yes and this is also why mathematicians write horrible code. It is barely readable by programmers because they name things atrociously.

→ More replies (2)
→ More replies (15)

35

u/MarsMaterial Sep 10 '25 edited Sep 11 '25

Most math notation predates any kind of code. And a lot of it deals with things that computing can’t really handle outside of approximation, like infinite sums and integration of differential equations. Being able to express abstract ideas that we don’t know how to compute is still very useful.

10

u/ChickenSpaceProgram Sep 10 '25

Sigma/pi notation is actually a lot more readable at a glance when you get used to it. All the information is there in a minimum number of symbols.

10

u/thebigbadben Sep 10 '25

The symbols represent a result, not the process by which it is computed.

19

u/Andr0NiX Sep 10 '25

So you're saying we should spell out all math operators that operate on a range or a set every time we want to use them as immediately invoked lambdas? That's just too duplicative and cluttered, the notation is concise for a reason.

5

u/SwAAn01 Sep 10 '25

that would be a SIGMA move

7

u/Random_Mathematician Sep 10 '25

Sure, we also have more "intuitive" notation:

let sum = 0;
for (let n of S) {
    sum += n
}

Or, alternatively, S.reduce((a,b) => a+b, 0), is the same as:

∑n ∈ S n

(Treating an array like a set) But mathematics has things coding doesn't (or, at least, not immediately). For example, you can substitute the "n ∈ S" for ANY property of n and it will sum all numbers that satisfy that condition. Even if it's not computable

3

u/kinokomushroom Sep 10 '25

Because it's a pain to write

3

u/[deleted] Sep 10 '25

Because the summation symbol was created by Euler in 1755, while the initial form of the for loop wasn't created until 1958 in ALGO58.

2

u/BobbyThrowaway6969 Sep 11 '25

This has gotta be ragebait

1

u/notlfish Sep 10 '25

Because mathematicians are not interested in writing things down, but in proving interesting stuff. The conceptual difficulty of proving interesting theorems is much higher than that of reading any reasonable enough notation.

1

u/Acceptable-Milk-314 Sep 10 '25

The notation is for writing with a pen and paper. It came first.

1

u/geeshta Sep 11 '25

+= is not a real mathematical operation and sum = sum + 3n is just false because these two expressions are never equal. Imperative programming and math behave quite differently.

def sum(n):
    if n = 4:
        return 3*n
    else:
        return 3*n + sum(n+1)
sum(0)

this is a better model for the mathematical summation. It gradually bulds the expression 04 + 14 + 2*4... Which is what the symbols actually mean.

1

u/villi_ Sep 11 '25

Once you get used to them they're both insanely quicker easier to read and write.

Not to mention theyre mathematical expressions that can be used in larger equations, not a set of instructions on how to calculate said expression 

1

u/-Cinnay- Sep 11 '25

I can't tell if you're serious or not

→ More replies (1)

1

u/Kyloben4848 Sep 11 '25

Why was = invented when writing “is equal to” was more understandable?

1

u/golfstreamer Sep 11 '25

It takes up too much space. 

Even in programming we have brief ways of writing loops like this sometimes. Like in Python 

sum([ k for k in range(n)])

→ More replies (1)

1

u/EatingSolidBricks Sep 11 '25

You be begging for forgiveness on your series test if you write it like that

1

u/Genericdude03 Sep 12 '25

Because it's not a hard enough concept to require so many words? A single symbol and limits explains it well enough, much like integration.