Ask HN: Which areas of math are practical to programming/algorithms and why?
41–50 of 101 posts
Re: Ask HN: Which areas of math are practical to programming/algorithms and why?
#42I've been recently trying to make my way though Elements of Programming ( https://www.amazon.com/Elements-Programming-Alexander-Stepan... ) by Alexander Stepanov and Paul McJones and it makes me say abstract algebra. It's the first and only rigorous foundation of software engineering that I've seen. It basically maps abstract algebra to this somewhat simple subset of C++, introduces new algebraic objects (such as mem…
Keean Schupke has started to explore the Elements of Programming in Rust. See: http://lambda-the-ultimate.org/node/5330 I know Alexander Stepanov personally, and Paul McJones through him, and they are both interested in seeing the ideas in the book implemented in other languages. Rust is a particularly compelling candidate, because it allows you to specify type constraints on generic functions through traits. This is…
Also, a while back, I reinvented InputIterators, OutputIterators and `std::copy` in a more type-safe way, using algebraic data types: https://github.com/eduardoleon/shit . (Sorry for the repo's name!) Although I only provide Standard ML and Scala implementations, this is perfectly doable in Rust as well. (In fact, my code is linearly typed, not just affinely typed.) The only requirements for a port to another language are parametric polymorphism and algebraic data types.
Re: Ask HN: Which areas of math are practical to programming/algorithms and why?
#43linear algebra | graphics, scientific computation, mostly graphics.
discrete probability | a whole shitload of perf solutions, understanding risk while planning
number theory, particularly factorization | modular arithmetic for crypto, a lot of very clever hacks for compressed representation of state spaces
predicate logic, basic set theory | I cannot count the number of times someone I work with has expressed something that required one elegant logical operation in a horribly convoluted way.
ammortized analysis | just learn it
statistics | operational reasoning using performance metrics, how to test/alarm rationally, how to reason about your customers
calculus | marginal returns (important when managing a team and optimizing where to spend resources). also if you ever end up doing any kind of convex optimization, which you might, maybe. (I do, but I don't think that's super normal outside datascience).
TL;DR: there's a reason CSCI curricula look like they do.
Re: Ask HN: Which areas of math are practical to programming/algorithms and why?
#44I want to stress before answering that everything you learn is useful if your mind is limber and willing to make connections. Some of the most valuable lessons in programming I learned from editing a philosophy journal in graduate school. I'll answer in terms of mathematical areas/concepts I've found immediately applicable in my programming career (format: what | why): linear algebra | graphics, scientific computatio…
There are some things you don't want to learn, and there is also an oppurtunity cost to learning/practicing A instead of B.
Re: Ask HN: Which areas of math are practical to programming/algorithms and why?
#45Re: Ask HN: Which areas of math are practical to programming/algorithms and why?
#46I want to stress before answering that everything you learn is useful if your mind is limber and willing to make connections. Some of the most valuable lessons in programming I learned from editing a philosophy journal in graduate school. I'll answer in terms of mathematical areas/concepts I've found immediately applicable in my programming career (format: what | why): linear algebra | graphics, scientific computatio…
> I want to stress before answering that everything you learn is useful if your mind is limber and willing to make connections There are some things you don't want to learn, and there is also an oppurtunity cost to learning/practicing A instead of B.
Good instincts require a breadth of knowledge, moreso than a depth in any particular domain. Precise logical reasoning requires practice and patience in any of a very wide range of fields, not exclusive to mathematics. In both cases, I think developing a careful knowledge of history or neuroscience or any rigorous intellectual discipline is effective practice, although I think a foundation in logic is irreplaceable.
Being an excellent programmer in some specific domains requires deep domain specific knowledge in applied math, which does have a steep opportunity cost. Absolutely. But I did not believe that was the question at hand.
Re: Ask HN: Which areas of math are practical to programming/algorithms and why?
#47Re: Ask HN: Which areas of math are practical to programming/algorithms and why?
#48Basic algebra for the substitution model and basic calculus for high order functions and the notion of a transformation in general. Set theory is, probably, the most fundamental. Everything could be defined as a set or as a function. Lambda calculus, obviously. Some combinators. Basics of linear algebra. No category theory and other bullshit is needed. Sets will do. It is actually very important skill to avoid wastin…
This. So much this. I've lived in a few hacker houses and worked at hacker spaces in the last year. The most impressive programmers I met had picked up just one set of skills (mostly web dev or mobile dev) and while being good at just one thing is less glamorous, these people were actually finishing projects. It was really incredible to watch them create and transform a project into real life in a very short amount of time. The most frustrating people I met were ones trying to learn everything--Machine Learning, IoT, VR/AR, mobile, web full stack--and getting nothing done on a daily basis.
The math you need to learn is completely dependent on what programming you want to do. What will be most impressive is your ability to focus on one or two areas and not get distracted into trying to learn all of it, and not feel envy towards those who are experts in domains that you don't know.
Re: Ask HN: Which areas of math are practical to programming/algorithms and why?
#49Understanding (that there is) a relationship between computability theory and just basic thought is one of the (if not the) most important takeaway from my (disastrous) college career.
Benson Mates [1] is the canonical (succinct) textbook.
[1] https://www.amazon.com/Elementary-Logic-Benson-Mates/dp/0195...
Re: Ask HN: Which areas of math are practical to programming/algorithms and why?
#50I want to stress before answering that everything you learn is useful if your mind is limber and willing to make connections. Some of the most valuable lessons in programming I learned from editing a philosophy journal in graduate school. I'll answer in terms of mathematical areas/concepts I've found immediately applicable in my programming career (format: what | why): linear algebra | graphics, scientific computatio…