Live data from Hacker News

Programming is not math

sarahmei.com

31–40 of 115 posts

Re: Programming is not math

#31
post #5

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... > I would say that math, almost alon…

Programming 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.

Re: Programming is not math

#32
Oh, came-on. Programs are math, programming obviously is not. Programming is creating math. And yes, math is a king of language.

I'd ask why do so many people think that math is only computations with numbers, but I do know the answer. It's a shame schools everywhere[1] put so many effort in taking all the creative parts from their math curriculum.

[1] Or should it be "almost everywhere"? I'd be delighted to hear about an exception, but I never had.

Re: Programming is not math

#34
> If you took a dynamic methods class in school, you know that big-O notation is pretty much meaningless in the real world. Which is to say, it doesn’t matter how an algorithm operates on an arbitrary set of data

I once spent a day or two trying to figure out why our network simulation was grinding to a halt.[1] The research guys, of course, blamed us engineering guys (you're writing slow code!) Turns out that one of them changed a key algorithm so now it was exponential in the number of nodes in the network. Worked fine when he did a quick 5-node sanity check on his machine, but wrecked havoc on the 50-node full-scale simulation.

Yeah, you can get a surprising amount of stuff done by just derping around. Doesn't mean the educational system should encourage that.

[1] This was a few weeks before a major milestone demo, and days were precious.

Re: Programming is not math

#35

Earlier quoted context omitted.

> We don't tell people they can be bad at talking. The brain evolved to communicate effectively with others. It did not evolve to manipulate symbols in a logical way. We can do it (some of us rather well) since the brain is still quite flexible. But it may account for the difference.

Then there's the Molière character I can't remember from Candide who says the nose evolved so we can rest our eyeglasses.

I think you mean Pangloss, who was a parody of Leibniz in Candide who was written by Voltaire. [0]

Is there some connection to Molière that I was unaware of, or was that just a brain fart?

[0]http://en.wikipedia.org/wiki/Best_of_all_possible_worlds#Cri...

Re: Programming is not math

#36
Well I suppose if you're just doing basic web programming you're not doing math. But even that (animations, etc.) can involve a ton of math.

Low level programming, the programming high languages are based on, use a lot of math. Using ruby on rails is just abstracting you from the math you'd have to do if you were actually programming something hard.

Re: Programming is not math

#37
post #23

Earlier quoted context omitted.

Anybody who has the aptitude to make a career in a given field, has the aptitude to teach themselves, with a bit of guidance from a syllabus, a professor, and/or a TA. Most learning inherently must be done by the learner. The learner has to study the material at their own pace, and then practice, practice, practice. There is very little a third party can do to expedite the process, other than provide overall trajecto…

It's hard to disagree with a statement like "learning inherently must be done by the learner", because what are the instructors to do, stick their hands into the minds of a student and place the knowledge there? However I think you (and attitudes like this) go a long way to discount the skill required to provide guidance, to recognize when the learner is really stuck, to review output, and construct an overall trajec…

You might find it interesting to read some Seymour Papert, e.g., Mindstorms and The Children's Machine.

Re: Programming is not math

#38

Couldn't it be said that math itself just another language used to describe deeper processes?

Math, English, Python, Chinese, Ruby - these are all just languages. Programming languages and Math are simply languages designed to be good at describing phenomena that can be defined with precision. Programming languages are optimized for describing precise sequences and procedures, while the language of Math is optimized for describing precise proofs. You could actually write pretty much anything that is written i…

Precise English is "Legalese" - lots of definitions, qualifiers, and words having precise technical meanings.

Re: Programming is not math

#39
I took a programming course where we wrote a number of programs in assembly language. We were given a set of rules and operations, a starting point, a goal, and we spent our time carefully assembling sequences of statements that took us from the starting point to the goal while obeying the rule system.

I took a math course where we did a number of proofs in natural deduction. We were given a set of rules and operations, a starting point, a goal, and we spent our time carefully assembling sequences of statements that took us from the starting point to the goal while obeying the rule system.

I'm dense, but I wondered about the strength of the correspondence between the two. It turns out that there's a nice paper by Philip Wadler [1] that illustrates the equivalence of natural deduction (math) and Church's lambda calculus (math, but programming).

[1] 'Proofs are Programs: 19th Century Logic and 21st Century Computing', Philip Wadler

Re: Programming is not math

#40
I've often wondered whether we should think of things the other way round; ie, whether secondary education in mathematics could benefit from a programming component.

Certainly, for my part, becoming a developer kindled an interest in some higher maths, when ten short years ago I was slogging resentfully through my A level. I now love playing around with things like Haskell, precisely because of the 'mathsiness' of it, although I'm at a disadvantage from having not pursued it further before.

It seems to me that a bit of simple code could make the stuff seem more 'real' and interesting than it did to a lot of my peers back then. (And, of course, there was the whole 'try it in basic!'[0] thing in American textbooks.)

[0] http://www.salon.com/2006/09/14/basic_2/

Post reply on HN