I have only studied up to real analysis. But definitely not a whole semester worth; my experience with analysis has been analogous to Poor performance in a quarter based analysis course. I did some exercises but not many.
I have heard from an mit professor[1] that math is the way to learn to think rigorously. So I’m curious about this and I’d like to improve my thinking skills in the hope that I will become a better programmer.
In an article a math professor said that there was some evidence that math improved logical skills[2].
So I’m wondering if any of you noticed that your thinking skills improved thereby making you a better programmer after studying analysis or topology or some other proof based math course.
Also which math other than the math required in CS programs should one study to be a better programmer and thinker? Thanks [1] https://m.youtube.com/watch?v=SZF0MFm9pqw&pp=ygUTQWR2aWNlIHJ1c3MgdGVkcmFrZQ%3D%3D [2] https://www.nytimes.com/2018/04/13/opinion/sunday/math-logic-smarter.html
Now I mostly do full stack web development (I have goals that require doing it), and I do often think about my programming informed by intuitions from topology and algebraic geometry (e.g., scopes in programming are like neighborhoods in topology). Having experience with formal logic and proofs also helps in reasoning about what code I'm looking at will do. Experience with rigorous mathematics also makes me more humble about just how difficult it is for anybody to ever reason correctly about anything.
I taught mathematics to many undergrads over the years, and I would recommend anybody interesting in a career in programming also learn at least the basics of group theory and abstract algebra. It's extremely beautiful, and probably different than the other mathematics you encountered, e.g., in high school or engineering courses. There's just so many beautiful and deep ideas in an intro abstract algebra course that aren't very difficult to learn. I initially got into mathematics when I was an undergrad browsing the programming section of a used bookstore, and found an abstract algebra book that was misfiled in the programming section.
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.
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.
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"
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
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, networking, file manipulation and more, that was the sort of thing I studied and exercised in my programming days.
For the record, I programmed Unix systems and services in C, Bourne shell, Perl, and similar languages. That was my professional career. Of course I got a real early start with BASIC, LOGO, and a little bit of assembly.
I think that those two things are useful mental models to have when learning programming, things that would be useful to have more as built in patterns than thinking step by step. And in that sense is useful to have a background in math. Maybe it doesn’t need to be too advanced, but at least at the level of thinking naturally in that way.
I am doing the opposite of what you are asking, as my day job is a mathematician, and I found my hobby of programming sometimes helpful.
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.
Not really sure about "better programmer", but I think it makes you at least more logical and helps develop a keener attention to detail. "Better programmer" entails an array of many other qualities outside of the scope of "better thinker".
Then my first programming class, in BASIC (in 1981), was taught by my high school math teacher, so there was a math perspective, plus my love of math probably biased my interests in programming. Today, I'm not employed as a programmer per se, but use programming and math as problem solving tools as a physicist.
I know programmers who are great at math, but most are not, and the ones who are take care of the math stuff in a team. Likewise with most engineers. So I'm hesitant to claim that math is a particular boon to learning programming. Rather, it is or it isn't, and that might influence what kind of programming you get into.
Like Joel Spolsky's article about programmers, I think there's a two humped distribution in terms of ability to grasp proof based math. If you discover by accident that you have a facility for it, then you might just try a few more courses because it's a boatload of fun.
https://blog.codinghorror.com/separating-programming-sheep-f...
Then it got a bit of reinforcement in my honors "1st semester calculus but we're proving everything" course.
How crucial it is for you to be able to accurately analyze large logical systems depends on the kind of programming you do. In many cases, it isn’t that important. I think I being comfortable with ambiguity, understanding how to satisfy multiple conflicting constraints, how to be political, etc. are probably much more valuable skills. Many programming jobs simply do not require you to be that technical to get your tasks done.
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 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
If 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.
Is “better programmer” a useful metric to problem solving? For a class of problems, probably.
Math and other hard sciences will probably give you a different perspective than a traditional CS education which may help with solving certain types of problems. Those may be programming related, or may be something else. Of course it may depend on the kind of person you are too.
In my opinion it’s worth pursuing whatever feels hard in terms of education, even if there’s not a rigorous CS education. You can always go into CS later.
I'd say studying mathematical proof is helpful for developing your proof making skills, but then it is best largely forgotten after you've internalised those skills.
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.
If you have a choice, I'd rather spend the time further studying algorithms and data structures instead of proofs. There's a ton to learn, and working through algorithms in pseudocode is always useful.