4 ms·
Mathematics is also a "communication language with really strict rules". In one sense, programming often uses math. And math often uses programming. But, in a
by tikhonj 13y ago
Mathematics is also a "communication language with really strict rules".
In one sense, programming often uses math. And math often uses programming. But, in a deeper sense, programming is math and math is programming. They're just different views on the same underlying ideas. They're different fields of study mainly because the priorities are so different.
Of course, this doesn't mean it makes sense to map Objective-C programming onto some "level" of math. For one, the whole math scale is completely arbitrary--who is to say that abstract algebra is more advanced than calculus? They're orthogonal. Moreover, Objective-C is in a part of programming which has really, really different priorities from normal mathematics. I still maintain that they're fundamentally related, but you're doing such different things that there's very little practical overlap. Certainly not enough to translate to some common sub-field of mathematics, much less one taught to high-schoolers!
- boomlinde 13y agoMathematics can easily be applied to anything from cooking to theoretical physics. That doesn't make any of these things math or the other way around. You can use math to solve a programming problem (perhaps to a greater extent than in cooking) and you can express many of the problems in mathematical terms, but in the end math is an abstract tool and programming is not.
- tikhonj 13y agoNo, the relationship between programming and mathematics is much deeper than that. In particular, it's not a relationship to the sort of mathematics you are thinking of--not the sort that you would use to solve a concrete problem or apply to physics or cooking. Rather, the relationship is between what a program is and the very foundations of mathematics--formal logic. In particular, a programming language is a formal system exactly the same way a logic is a formal system. A mathematical proof is really the same sort of object as a computer program. It just turns out that the goals behind the two are different, so the rules of the formal system (either a logic or a programming language) behave very differently. But, at a high level, it's the same idea. In fact, the way we ascribe semantics to programs and programming languages is analogous to how we can reason about proofs and logics. As a rough comparison, denotational semantics are like model theory and operational semantics are (sort of) like proof theory. That said, for the most part, this relationship to mathematics is actually orthogonal to the sort of math you would use in writing a program. Linear algebra, geometry, group theory and so on are great for applications but not what I was talking about. Instead, the mathematics I was alluding to only comes out when you get sufficiently "meta" and start writing programs that operate on other programs--static analysis, verification and so on. I'm not sure what you mean by "abstract tool", but programming is just as much an abstract tool as mathematics. The only difference is that we have some handy hardware for realizing the former.
- pavelrub 13y agoThis is philosophical mumbo-jumbo. When people program, they (usually) don't do math. And that's it. The fact that you can view a programming language as a formal system, and the fact that computer programs can be viewed as mathematical proofs of mostly totally uninteresting propositions, doesn't magically turn programmers into mathematicians, just as the fact that the brain can be viewed as a chemical and physical system doesn't turn every thought into a chemical experiment, and each thinking person into a chemist. Saying otherwise is just an abuse of language.
- tikhonj 13y agoIt depends on what you mean by "do math". Both a proof and a program are just syntactic manipulations following a particular set of rules. The exact rules differ, but the underlying system doesn't. Proving something in a low-level way--just following inference rules--and executing a program are basically the same things. This is abundantly clear if you formally study operational semantics, but even people who haven't still think operationally. Of course, nobody thinks purely operationally, but then again, practising mathematicians also rely on some poorly defined "intuition". I never claimed this makes programmers mathematicians. It doesn't. Both fiddle around with formal systems, but the goals and the actual practice differ enough to make the two fairly distinct. But they're still related and we still use the same tools to analyze both: automated theorem provers, type theory, Curry-Howard... The fact that I can bring advancements from formal logic to bear on analyzing programming languages and the fact that I can bring advancements from programming languages to analyze proofs means this is no mere "philosophical mumbo-jumbo". This includes all sorts of things you probably think completely removed from mathematics, like verifying properties of drivers or automated debugging. Not only is it a deep relationship to think about, it's one we regularly exploit. Even if most programmers do not acknowledge it, it exists. Really, you're saying more about the state of programmers' education than anything else. Besides, you never really made much of a point. You made a statement and a poor analogy in its support and accused me of "abuse of language", but never said anything substantial.
- nilaykumar 13y ago
- ssdfsdf 13y agoI'm not sure there is such a difference between mathematics and an "algorithm". Time can be factored out of a process. A process can be represented as a sequence of objects. Take a function taking some arguments, one can describe this function in it's entirety by describing each sequence of objects generated by each possible input. Then if one wants to recreate the operation of the function one simply looks up the appropriate sequence of objects. A function then becomes a mathematical object in the abstract. In the same way some mathematical object can be described as the result of some process. Take the definition of the natural numbers, an object 0 is defined and a successor to this object to the next object is defined. This operation defined recursively sets up the whole natural numbers. The description of the natural numbers is the result of the evaluation of this function recursively applied, or the infinite application of this function. Since the study of mathematics is the study of these abstract objects and these objects encapsulate those objects which we can produce in the physical world through some process, mathematics by definition is a study of programming. Whether the mathematics explored by mainstream mathematics is the same mathematics explored by the code monkey is perhaps relevant. But the duality exists. In essence a study of physical reality is the study of those mathematical objects which can be constructed by the processes extant in that reality. So analysis of anything is mathematics, it just may not be the kind of mathematics we usually associate with the word.
- boomlinde 13y ago> I'm not sure there is such a difference between mathematics and an "algorithm" Well, then we fundamentally disagree. An algorithm isn't math. Arguing about an algorithm mathematically, or even analyzing it at all as an algorithm might be related to mathematics, but the algorithm itself isn't.
- cma 13y agoBeg to differ: http://www.amazon.com/Our-Mathematical-Universe-Ultimate-Reality/dp/0307599809 http://www.amazon.com/Our-Mathematical-Universe-Ultimate-Rea...
- boomlinde 13y agoI'm sure that if you meant to argue with anything I said, you'd make a greater effort than posting a link to a book you enjoyed. But just in case: I believe that mathematics is able to describe very fundamental concepts of our universe. That doesn't mean that everything in the world _is_ mathematics, for the same reasons that the fact that you can describe many things in spoken words don't make them spoken words.
- etler 13y agoI think one major difference is that programming languages are mostly imperative while mathematical statements are more declarative. When you're solving a mathematical equation, you are typically given a statement which you need to transform into another form. How you do that is less important than proving that the alternate form is valid given the equation. You declare the problem and the solution you want to solve for first, and there may be multiple ways to get there, you just need to show a valid way.