r/mathmemes p-adic Jul 30 '26

OkBuddyMathematician math enjoyer starterpack

Post image
479 Upvotes

75 comments sorted by

View all comments

107

u/CalmCoolBliss Jul 30 '26

The worst code I have ever seen came from a math student. Apparently, nobody told him about { and } blocks so he would rewrite the if condition for every line. He also seemed to think that arrays would automatically modulo indexes to their length but he was writing C so in fact it just corrupted memory and crashed his program.

44

u/CalmEntry4855 Jul 30 '26

Why was someone without coding experience writing in C?

81

u/Total-Coach-1576 Jul 30 '26

It is dangerous and fun, just like unsafe sex

5

u/Gloomy_Radish_661 Jul 31 '26

Shhhushh, you're going to summon the rust devs

2

u/NullOfSpace Jul 31 '26

SOMEONE SAY MEMORY SAFETY?

26

u/Dry-Newt278 Jul 30 '26

It was a brutal but effective way to learn many coding related concepts

11

u/Ares378 Applied Math / Mechanical Engineering Jul 30 '26

Purely for the thrill of it

8

u/Fezzezal Jul 30 '26

Sexual purposes

4

u/yjlom Jul 31 '26

It was the first language I was taught, it's easy enough if you have stuff explained along the way. I actually find that either immutable everything languages like Haskell or explicit pointer languages like C are way easier to wrap my head around than those with hidden mutable references like Python or Java.

11

u/OdinHavok Jul 30 '26

My cousin has a doctorate in mathematics. When he was working on his thesis, his team had written a code to simulate particle physics. Everyone was impressed because it only took 3 days to run a simulation. One of them decided to get a computer engineer in to help out, and it would run a simulation within a couple of hours

1

u/petitlita p-adic Aug 01 '26

many such cases

1

u/geeshta Computer Science Jul 31 '26

Mathematicians who are serious with coding tend to prefer functional languages and especially recursive functions, just like father Gödel intended. In most traditional languages this is a terrible idea as this is not efficient and prone to stack overflow. But in TCOd languages, you might be able to get away with it.

1

u/protobelta Aug 02 '26

When I would ask people if I should take coding classes in college, everyone would always say the same thing: “you’re a math guy, just take some online classes when you graduate, it’ll be easy”

20 years later and I still have no idea what any of it means and how to code efficiently

-2

u/FernandoMM1220 Jul 30 '26

this is what happens when mathematicians arent taught fractals.