In which I react to some of the comments on my “Who needs code samples?” post.
Rather than quoting people, I will reply to some of the general ideas outlined in the comments. After this post, it’s case closed; this whole discussion has taken up way too much energy and time already.
Sample code contains implementation details, while formulas deal with the abstract concept (rather than a specific implementation).
No disagreement there. It would have been better if the book had given both formulas and example code. In an ideal situation, it would also have tried to abstract away some concepts (data storage, etc), or at least separate them from the actual algorithm. OTOH, this might not always have been possible, as performance is an issue as well.
Suggestions to look at SICM:
I have looked at this book before, but gave up on it before long. One of the reasons might have been the abudance of formulas; another is that I am not particularly interested in physics.
Competent programmers know how to read these formulas. Computer science is programming. Reading math formulas is a useful skill for programmers. You need a degree in CS to be a good programmer. (etc)
Here I refer to my previous posts about the relevance of math in everyday programming tasks.
The formulas described in the original article are not particularly difficult.
Probably, but they still require context to read them. In short: ||v1-v2|| requires that you know what v1 and v2 are, what || stands for, what subtraction means in this context. By contrast, vector1 – vector2 is a bit longer, but much clearer. My point is that I neither need nor want to know the context to read these particular formulas, because they have no relevance to my work.
Strong anti-math sentiment:
I believe this is related to the fact that some people love to shoehorn programming into the mathematics branch. It just doesn’t belong there; the math needed and taught in CS courses has little relevance to the real world (hence the vast numbers of CS graduates that are unprepared for a real programming job). This causes resentment.
In my case, there are other reasons why I object very strongly to the notion of “math is a requirement to be a programmer”. In fact, when I was ~16, I wanted to become a programmer, so studying computer science seemed a logical step; then was told that you needed to be good at math. This struck me as odd, since I had been tinkering with programming and it required very little math, but hey, people must know what they’re talking about, right? So I went on to do something else, keeping on programming as a hobby. I sold some of my homebrew programs. No math required. Eventually I landed a job as a programmer. Still no math required. That was 10 years ago; in the meantime I’ve written all kinds of software, very few of which need any advanced math.
This notion (“you need to be good at math to be a programmer”) almost stopped me from realizing my dream. I figured it must have stopped others as well, and still does, so I will do everything I can to fight this myth.
Formulas are a great way to express abstract concepts; their notation is really just another “language” one needs to learn.
This is true, but I’m unsure if learning this “language” will benefit me much (other than saving me from the scorn of Reddit readers ;-). Aside from that, the notation has problems… but that’s a different story.
Code examples in Haskell:
Haskell is interesting, but it does strike me as math notation disguised as a programming language. It suffers from some of the same problems: conciseness to the point of being unreadable, and little usefulness in the real world. That said, maybe someday I will make a serious attempt at learning it properly.
All this discussion has distracted from the fact that I don’t hate math, and am not particularly bad at it either. I just would prefer code samples in many cases. That’s all. I’m now going back to my coding. :-)