Live data from Hacker News

Ask HN: Did studying proof based math topics make you a better programmer?

news.ycombinator.com

11–20 of 54 posts

Re: Ask HN: Did studying proof based math topics make you a better programmer?

#11
Yes, though any subject which trains you to think with mathematical rigor will help.

I switched my major from CS to math midway through my undergrad studies. I have worked at startups and FAANG as a SWE so I have seen these skills in different engineering environments. A few things I’ve seen:

1. My later classes used the Moore Method which made whiteboard interviews much less stressful 2. I can spar with our data scientists and call out BS metrics rigorously in a very political environment at my current company 3. I can sometimes find pathological execution scenarios and bugs faster than my CS coworkers

The one caution is that time spent studying things that aren’t programming needs to be balanced with time spent programming

As for math outside of CS that’s helpful for programming and thinking, modern algebra and category theory can really help in understanding type systems and their limitations. They’re also very accessible when compared to stuff like differential equations and analysis IMO

Re: Ask HN: Did studying proof based math topics make you a better programmer?

#12
I think the proof mindseet was a huge help to me as a beginning programmer, BUT that was in the context of high school Euclidean geometry, not analysis, around the same time I was first learning a programming language that let you write functions. As I recall (long time ago now!) the two things kind of fed off of each other very nicely.

Then it got a bit of reinforcement in my honors "1st semester calculus but we're proving everything" course.

Re: Ask HN: Did studying proof based math topics make you a better programmer?

#13
No, I would not say it has.

Having a basic understanding of math can provide some value. For example, things like understanding Big O notation, or the fact that algorithms can be proven at all. Stuff like that provides you the right tooling to select the right algorithms for your problem.

However the actual proving part is mostly busy-work, and due to the Halting problem provides relatively little value in general programming. It might be useful if you want to develop a compiler or something, but most people don't.

Proof-based maths is the main reason why I dropped out of my Computer Science M.Sc. course. After a while it became painfully obvious to me that it didn't teach me anything I could actually use as a developer, and it was a waste of time if I didn't want to go into academics.

You'll learn more about programming by actually doing programming.

Re: Ask HN: Did studying proof based math topics make you a better programmer?

#14
I have an undergraduate degree and a couple years worth of graduate school in pure math (and continue to read/work through math texts on occasion when the urge strikes me), and can say with pretty high confidence that my ability as a programmer over my life has been relatively uncorrelated with the amount of math I've learned and my proficiency with understanding and writing mathematical proofs.

I do believe that having some baseline ability to think carefully, logically, and rigorously, while being able to shift your perspective between levels of abstraction as you analyze a problem, is very useful as a computer programmer, but I don't think mathematics is the only route (or even the best route) to acquiring that skill; I've had a number of colleagues over the years with no formal training or education in any sort of "STEM" field who were nevertheless quite adept programmers.

At the end of the day, based on both my own experience and what I've observed in friends and colleagues, the way to become a better programmer is the way to get better at most things in life: do a lot of it, find other people who are good at it and get their feedback, and stay humble enough that you'll be able to learn from your mistakes and change your thought processes. But mainly just do a lot of it.

That's not to say you shouldn't learn some serious math, of course: there's a lot of cool and interesting stuff to learn, and some of it even has useful applications. But the thing you get good at when doing math is, well, doing math, and if you really want to be a better programmer, your time is likely better spent writing software.

Re: Ask HN: Did studying proof based math topics make you a better programmer?

#15
If you are not passionate about it, than you should probably not study it. Also, studying Informatics should give you a lot of opportunities to showcase your extra skills, e.g you can study functional programming from the ground up. IMHO the much more interesting question is: How to cope with the upcoming of AI? This will probably make programming much cheaper and more less skilled people will come to sit right before your nose, tending to devalue higher education.

Re: Ask HN: Did studying proof based math topics make you a better programmer?

#16
I didn't graduate high school and I can program in multiple programming languages, and picking up a new one is pretty easy. I had to convert "math functions" into code before I could understand what the symbols meant when I was learning how to write ML software.

Imo you learn the academic lingo, and it can make it easier to communicate with other programmers, but you can just pick it up. School is for chumps.

Re: Ask HN: Did studying proof based math topics make you a better programmer?

#17

Yes, in the sense that "math is programming paper instead of computers", being better at one translates to being better at the other. This intuition can even be made precise via the "Curry-Howard isomorphism", upon which "proof assistants" such as Coq are built.

Lean mathlib was originally a type checker proof assistant, but now leanprover-community is implementing like all math as proofs in Lean in the mathlib project.

Lean (proof assistant) https://en.wikipedia.org/wiki/Lean_(proof_assistant)

"Lean mathlib overview": https://leanprover-community.github.io/mathlib-overview.html

"Where to start learning Lean": https://github.com/leanprover-community/mathlib/wiki/Where-t...

leanprover-community/mathlib: https://github.com/leanprover-community/mathlib

Re: Ask HN: Did studying proof based math topics make you a better programmer?

#18
I never studied any type of math, but I was always great at logic, taking at least a half dozen philosophy and theology courses throughout my univeristy experience. I did take a few programming classes in place of several math courses, just to avoid mathematics... I think my highest math class was Algebra II. I didn't go the route of a computer science major because I didn't care about trigonometry or calculus classes, though still managed to land a science degree of psychology. I can see why college cirriculums may require computer science to have certain math courses, but if you can figure out the logic of how things work, you can get out of math courses and still be a programmer ;)

Re: Ask HN: Did studying proof based math topics make you a better programmer?

#19
I lie to people about programming all the time.

I tell them it's not about math, you just have to think logically through every step.

With more steps comes more scrutiny, so you study how to optimize.

You will read papers about optimization to reduce the number of steps.

Those papers have a suspicious amount of math.

By the time you discover, "...wait, its all math?"

"Always has been."

What I personally found helpful was the book The Algorithm Design Manual [0]. It starts right off with math, but in a way that connects it to basic primitives of programming. You start building up an algorithmic understanding as you increase the computation complexity. It was very intuitive for me, both for understanding the math and understanding Big O in a rigorous manner. From there it dives into actual algorithms and code, but the math returns periodically.

[0]: https://www.algorist.com/

Re: Ask HN: Did studying proof based math topics make you a better programmer?

#20
If your goal is become a better programmer, your time is better spent working on challenging programming problems.

If you enjoy math, go do some math. It might help you see problems differently. If you don't enjoy math, don't grind through it.

In general, the best advice for the question "I want to get better at $skill, should I study $subject?" is "just do $skill"

Post reply on HN