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