I’ve heard many times that all programming is really a subset of math. Some suggest that OO, at its roots, is mathematically based, but I don’t get the connection, aside from some obvious examples:
- using induction to prove a recursive algorithm,
- formal correctness proofs,
- functional languages,
- lambda calculus,
- asymptotic complexity,
- DFAs, NFAs, Turing Machines, and theoretical computation in general,
- and the fact that everything on the box is binary.
I know math is very important to programming, but I struggle with this ‘subset’ view. In what ways is programming a subset of math?
I’m looking for an explanation that might have relevance to enterprise/OO development, if there is a strong enough connection, that is.
Overall, remember that mathematics is a formal codification of logic, which is also what we do in software.
The list of topics in your question is loaded with mathematical problems. We are able to do programming on a fairly high level of abstraction, so the raw mathematics may not be staring you in the face. For example, you mentioned DFAs.. you can use a regular expression in your programs without knowing any math, but you’ll find more of a need for mathematics when you want to design a good regular expression engine.
I think you’ve hit on an interesting point. Programming is an art and a science. There are a lot of ‘tools of the trade’, and you don’t necessarily sit down and do a lot of high-level mathematics in order to simply write a program. In fact, when you’re programming, you many not really being doing much mathematics or computer science.
It’s when we start to solve difficult problems in computer science that mathematics shows up. The deeper you go, the more it will flesh itself out.. often in lower levels of abstraction.
There are also some realms of programming that you don’t necessarily have to work in, but they involve more math. For example, while you can certainly learn a language and write some apps without any formal mathematics, you won’t get very far in algorithm analysis without some applied math.