Ask HN: Did studying proof based math topics make you a better programmer?
41–50 of 54 posts
Re: Ask HN: Did studying proof based math topics make you a better programmer?
#42Doing a lot of math definitely helps you think rigorously. Doing programming forces you to think rigorously.[1] So it's not clear if math is a value add in that direction.
I think the only way math has helped me is that mathematicians tend naturally to think "functionally", so for me switching from C/Python to more abstract functional programming (be it in Scheme or ML based languages) was fairly easy. In fact, I was already trying to program functionally in Python before I knew what that even meant.
On the whole, I would say: Study more math if that's what interests you - but not with the expectation of becoming a better programmer.
[1] See also my prior comment that discusses a Field's medalist's comparison between math and programming: https://news.ycombinator.com/item?id=36344681
Re: Ask HN: Did studying proof based math topics make you a better programmer?
#43I received a Ph.D. in pure math (number theory) from Berkeley, and then worked as an academic mathematician for 20 years, so wrote a few dozen research papers and some books. My ability to write software for doing mathematics was obviously better as a result of studying mathematics, e.g., I started SageMath ( https://sagemath.org ) and wrote a big chunk of it. Now I mostly do full stack web development (I have goals…
Re: Ask HN: Did studying proof based math topics make you a better programmer?
#44No. In fact, I didn't study any of that. I'm bad at math. I took a required Calculus course (again) about 5 years ago, and struggled mightily, although I did achieve an "A". For the things I've programmed, I barely needed any math. I found it more beneficial to study things like systems architecture and computer science. Knowing theories behind data structures, functional/imperative programming, algorithms, networkin…
> For the things I've programmed, I barely needed any math. I understand that countless engineers have this opinion, but really (and bluntly) all it means is that you’re unaware or ignorant of how maths applies to what you’re doing.
Re: Ask HN: Did studying proof based math topics make you a better programmer?
#45I 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…
[0] Had plenty of books to select from. Kenneth Rosen's was the only one I liked. Knuth's Concrete Mathematics is great if you decide to give a subject a second go -- the material is somewhat different, more abstract, and the side notes by his students are hilarious.
[1] https://www.mathsisfun.com/puzzles/5-pirates-solution.html
Re: Ask HN: Did studying proof based math topics make you a better programmer?
#46If you asked me to describe a 'better programmer' in a professional setting, it would probably be:
* writes understandable code
* knows when to optimise/dedupe /abstract, and more importantly, when not to
* treats it like a craft, but knows that pragmatism is also key
* can communicate about code, explain concepts and just be generally helpful and pleasant to others in or outside the team
Thats IMHO anyway, and those things don't seem to have much to do with math.
Re: Ask HN: Did studying proof based math topics make you a better programmer?
#47Re: Ask HN: Did studying proof based math topics make you a better programmer?
#48I did a lot more math before focusing on programming, so it's hard for me to say. Doing a lot of math definitely helps you think rigorously. Doing programming forces you to think rigorously.[1] So it's not clear if math is a value add in that direction. I think the only way math has helped me is that mathematicians tend naturally to think "functionally", so for me switching from C/Python to more abstract functional p…
Would that it were so! But alas a lot of software is happy-path only because many programmers don't tend to think mathematically. In contrast mathematical proofs tend to be absolutely bullet proof.
I can only assume that the mathematician who wrote the quote in your footnote was talking about maths notation vs computer language syntax. In that narrow sense, yes programmers need to be more careful. But software doesn't need to be anywhere near logically correct to run, and he seems to agree that in fact it never is correct.
In contrast, logical errors in published mathematical proofs are relatively rare.
Re: Ask HN: Did studying proof based math topics make you a better programmer?
#49I did a lot more math before focusing on programming, so it's hard for me to say. Doing a lot of math definitely helps you think rigorously. Doing programming forces you to think rigorously.[1] So it's not clear if math is a value add in that direction. I think the only way math has helped me is that mathematicians tend naturally to think "functionally", so for me switching from C/Python to more abstract functional p…
>>> Doing programming forces you to think rigorously. Would that it were so! But alas a lot of software is happy-path only because many programmers don't tend to think mathematically. In contrast mathematical proofs tend to be absolutely bullet proof. I can only assume that the mathematician who wrote the quote in your footnote was talking about maths notation vs computer language syntax. In that narrow sense, yes pr…
They really, really do not. It's why an initial proof of the four coloring theorem was believed for a decade before a flaw was discovered. History has quite a few examples of proofs believed to be correct for years that turned out to be flawed.
Read the quotes from William Thurston's essay in the comment I linked to. I've spent time with professional mathematicians, and they say that finding errors in papers is not at all unusual - I've seen estimates as high as a third of papers have an error.[1] This doesn't concern them as even though there are errors, they have good reasons to believe the correctness of the theorems and freely will use them as references to their own work. Thurston's essay goes into detail as to why that is.
> I can only assume that the mathematician who wrote the quote in your footnote was talking about maths notation vs computer language syntax.
While the quote I supplied was in the context of notation, the essay addresses the wider issue.
> But software doesn't need to be anywhere near logically correct to run
Indeed, and his analogous statement is that proofs don't need to be completely correct to believed :-)
I believe he cites Wile's proof of Fermat's theorem. At the time of writing, he had presented his proof and a flaw had been found - the fixes came after his essay. So at that time, he knew the proof had problems. Yet he points out most people believed that Wile's approach was correct, and resolving the problems in his proof were a matter of detail. This wasn't a matter of faith. Those mathematicians understood the theory Wiles used well enough to have a good intuition that the reasoning was sound. It was certainly challenging to resolve the bug(s) in his proof - the Wikipedia page indicates he almost gave up. But I suspect that had this been a less dramatic theorem, the pressure to fix the flaws would not really be there.
Of course, at times that intuition turns out to be surprisingly wrong. But those tend to be the exceptions.
[1] This link points out that about 1.4% of published papers have corrections: https://mathoverflow.net/questions/291890/what-percentage-of...
However, I believe that most flaws that are found are not corrected (i.e. the author doesn't bother sending in a correction).
Here is an anecdote from Kevin Buzzard, who is a proponent of formalizing proofs using computers:
> It is true that there are holes in some proofs. There are plenty of false lemmas in papers. But mathematics is robust in this extraordinary way. More than once in my life I have said to the author of a paper "this proof doesn't work" and their response is "oh I have 3 other proofs, one is bound to work" -- and they're right.
...
> But until then I think we should remember that there's a distinction between "results for which humanity hasn't written down the proof very well, but the experts know how to fill in all of the holes" and "important results which humanity believes and are not actually proved".
Taken from https://mathoverflow.net/questions/351640/extent-of-unscient...
Re: Ask HN: Did studying proof based math topics make you a better programmer?
#50Earlier quoted context omitted.
> For the things I've programmed, I barely needed any math. I understand that countless engineers have this opinion, but really (and bluntly) all it means is that you’re unaware or ignorant of how maths applies to what you’re doing.
A developer can barely need maths and also benefit from an understanding of maths at the same time. Unsure what your point is, if not just to dunk on programmers without math backgrounds.