4 ms·
Honestly, I've wavered on this topic...I used to think that math wasn't an inextricable part in understanding programming, since it doesn't seem we do anything
by danso 12y ago
Honestly, I've wavered on this topic...I used to think that math wasn't an inextricable part in understanding programming, since it doesn't seem we do anything more taxing than incrementing values by one, on a day to day basis. This recent interview with mathematician Jordan Ellenberg really piqued my interest though:
http://host.madison.com/entertainment/arts_and_theatre/books/q-a-make-friends-with-math/article_2da7c6f3-ba4c-5f02-8db3-b0fbc7e1d287.html http://host.madison.com/entertainment/arts_and_theatre/books...
> I would say that math, almost alone in the school curriculum, is the one place that you can create knowledge absolutely from scratch and know that you’re right. That’s rather amazing and I think that’s one reason math has a central place in school. If you’re taking history and someone says, “This is what happened in the Eisenhower administration,” you have to take the teacher’s word for it. If you don’t, you can look it up in a book and you compare that book’s authority to your teacher’s authority, but in the end you have no direct access to what’s true and what’s false. Math is different. In math, you can actually directly perceive what’s true and what’s false. You can count and you can measure and you can create that knowledge for yourself. That’s an incredibly powerful thing. If students come out of their math classes in school without really experiencing that, that’s quite a waste because it’s very special and it’s something only math can offer.
This, for lack of better term, faith in logical proof...that certain forms of analysis and problem solving can be built from and derived in an irrefutable way...that's hard to get across to novice programmers...such as the idea that debugging is not just a matter of luck and randomness, no matter how complicated that stack trace or how you cross your fingers when turning on your computer, but of logical deduction.
Sure, everyone who is an adult goes through many years of math to graduate high school...but how much do they really appreciate that mathematical assertions can be, as Jordan puts it, basically created from scratch and be irrefutable? Which is something that you can't say for many non-math topics that we run into day-to-day? And if you don't have that grasp...even if all the actual math you do in your code is x += 1...you may not have the intellectual fortitude to deal with all the ways code can diverge and break.
- tel 12y agoI was just reading Per Martin-Löf's On the Meanings of the Logical Constants and the Justifications of the Logical Laws [0] which talks about this exact notion from Martin-Löf's modern intuitionistic logical perspective. This paper is a little dense and meandering, but I challenge anyone with an interest in the relation of programming and mathematics to take it on. An ultimate conclusion it attempts to justify is that theory and proof (identical to "type and program") are a noun and a verb respectively. The act of consuming a proof is the one where you, the reader, consume some evidence which subsequently substantiates the proposition of interest. What that means in relation to this parent's notion is that mathematics, and indeed programming or anything which can be connected so strongly to formal logic, necessarily draws all of its meaning from the words used to express it... and thus, once you've heard them (read a proof, seen a program) you have all of the facilities necessary to manipulate it and test it and learn more. Which is exactly what makes all of these bodies of work, together, so accessible and wonderful. And it's exactly why history always feels less powerful. [0] http://www.ae-info.org/attach/User/Martin-L%C3%B6f_Per/OtherInformation/article.pdf http://www.ae-info.org/attach/User/Martin-L%C3%B6f_Per/Other...
- jerf 12y agoProgramming is deeply and inextricably mathematical. However, most programmers don't actually know mathematics, so it's difficult to see that. This is further exacerbated by the fact that people creating APIs and libraries also don't know math, so they don't see it, and consequently design APIs and libraries that don't show mathematical characteristics. (This is not because they are "better"... it just means that mathematically these libraries and APIs are mind-bogglingly large and complicated objects, instead of simpler and more powerful ones.) Schools don't teach much math. Non-zero, but not much. Even a computer science bachelors degree teaches only a smidge of math, and not enough to learn how to correctly apply it to real code. If you're not doing proofs in school, you aren't doing math in school. I do not mean that all math is proofs or that only proofs are math; I mean literally what I said... if you are not doing proofs in school, you are not doing math in school. (If you get up to post-grad this can change a bit, but pretty much all that is available to bachelors students are in these courses.) You can use this as a yardstick to see how much math you actually know; if your proof experience was confined to just one or two classes where you begrudgingly wrote a few proofs, you don't really know math, and, well, probably shouldn't be arguing about whether programming is or is not this other thing that you don't even know. Memorizing a series of legal transformations of equations with perfunctory walkthroughs of their validity by a disinterested professor is not math. It's calculation. If you've observed to yourself that a computer could well do that... well, yes, they could. Computers remain fairly bad at math but they've got us creamed on computation, even symbolically. The calculation you learned is not math. Math is about building systems of axioms, building on those axioms, learning what you can and can not guarantee, how to maintain those guarantees, how to build big things based on those guarantees. Safely refactoring code while maintaining its behavior is math. Building an API with simple primitives that can be safely combined to obtain various useful effects is math. Compilers are big piles of math about graphs and nodes. And I could go on and on. Pretty much every program I write is a simultaneous exploration of what the simplest primitives are that I can write and the operations for safely combining them, and this includes even brutally practical systems like process monitoring or memory pools. To the extent that the average developer's refactoring is generally not safe, that indeed the language itself probably doesn't even permit truly safe refactoring, that most APIs are not built around simple, powerful, safe primitives, that most "compiler"-y code is a big pile of hacks, and so on, that doesn't show programming isn't about math. It shows that most programmers are bad at the relevant math, often to the point of complete ignorance that math is even involved, indeed often not even knowing the relevant words for the basic things. Consequently, yeah, they argue that programming isn't math. It is. They just don't realize it because they lack the skills. This is not targeted specifically at the original author, BTW. "Programming is not math" is a widely shared opinion.