3 ms·
I like to think that CS is just a different approach to math. Of course, I say this as somebody who likes Haskell where the programmers work really hard at pre
by tikhonj 15y ago
I like to think that CS is just a different approach to math.
Of course, I say this as somebody who likes Haskell where the programmers work really hard at pretending to be mathematicians :)
However, even when I'm writing in other language, I think about things in terms of math. Additionally, my CS courses so far have all been heavily influenced by math, except for systems that was much more heavily influenced by EE.
So, at least for me, programming is very much like math. Just shinier. And I do think that more math--or at least mathematical thinking--would help most programmers.
However, the rant against testing is just silly. Tests are not a replacement for math--they augment it. We need tests because, at heart, CS is an engineering discipline: math is just a tool we use very pervasively.
Haskell is one of the more extreme typed functional languages, and yet Haskell programmers are very amenable to testing. In fact, Haskell programmers tend to go above and beyond normal testing: we use property-based testing (QuickCheck). Instead of just having unit tests, we actually generate random tests.
Besides, lets look at physics: they have great mathematical models. However, as soon as you actually apply physics--basically engineering--you need to test everything extensively. There is a reason we have exhaustive crash tests, after all.
So: math is good for programmers. Tests are also good for programmers. The two cannot replace each other.
- tel 15y agoI tend to think of Haskell as a language designed by mathematicians but not for mathematicians. Not even to say that it's not useful for doing math but simply that it's not structured to explore ideas via proofs. Consider Coq or Mathematica which are definitely designed with that goal in mind. I think programmers aren't doing math at all, but I think what programmers do is better, more adroitly, done when its guided strongly by math. For that reason I think programmers should learn lots of math, even if they don't spend much time proving things for their own purposes.
- silentOpen 15y agoThe program is a constructive existence proof of the theorem structures embodied in the type system.
- tel 15y agoI'm aware. I suppose I think of the theorems as less interesting though usually.
- gbog 15y agoAgree with the rest, but not with "math is just a tool". Math here is not about answering a question like "what are the coordinates of the point in the middle of those two points here". It is not a tool helping to solve a restricted set of computation problems. Math here is the model for the deterministic handling of a data system and its evolution in time. The silliest glue code is still math: "if button.push('a') thing.do_action('a_action')" translates to "For any x in A_Button_Pushes, action = f('a_action')".
- matwood 15y agoExactly. Let me also add that math isn't so much a tool as it is a way of thinking. Learning (or should I say understanding) more math helps in all sorts of non-obvious ways. From thinking logically, to seeing intuitive shortcuts, to proofs (used nearly every time a program is debugged), to algorithms, programming is one of the greatest concrete implementations of the math abstract.
- tikhonj 15y agoYes, I understand that. What I meant is that math is a tool in the same sense a programming language or methodology is a tool--it's something we ultimately use as a means to an end. If our only goal was math, we would actually be mathematicians ;)