Live data from Hacker News

Programming is not math

sarahmei.com

41–50 of 115 posts

Re: Programming is not math

#41

I've seen someone take a piece of code from 72 lines down to 3 lines by just doing some simple mathematical analysis before actually getting to refactoring. The code was also simpler, and easier to understand. Do you need math for be a good programmer? No. Does it help to know math while programming? Absolutely.

That's sounds like example of someone with math skills applying them to make an awesome bit of code.

But I've also heard about math PhDs write the sloppiest code code imaginable: functions 1000+ lines long, copying and pasting functions to add a parameter... (in production code for a software company, not a research project).

So like you said, math helps but I'd like to extend that thought and say that you can make bigger gains elsewhere. For example, if you're a sloppy coder and don't know math, go out and get a book like "Code Complete," "The Pragmatic Programmer" or "Clean Code" first.

Re: Programming is not math

#42
post #13

as an aside it's kind of interesting why there isn't as much research on teaching programming as their is say on refinement types, separation logic or pointer aliasing. I think the reasons are annoying. In academic research, nobody cares about education. The big universities that you think of as education powerhouses like Stanford, MIT, CMU, are all at heart research universities. Their faculty were not hired because…

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…

You are presupposing a basic level of proficiency and access which is 80% of the way there. Anyone who has made it, can make it.

Re: Programming is not math

#43
Learning a programming language is a lot like learning a human language, but understanding math is how you learn efficient programming.

If you don't use mathematical reasoning, then you'll produce O(n^3) when you could have produced O(n). Any hack can throw together a script that will hobble along with 4 rows of data. Throw a million rows at the same script and it might terminate properly in a few years. Or maybe it just runs out of memory half way through.

Another problem is winding inefficient boolean branching. If you don't understand boolean algebra, you either over specify cases which makes code cluttered and disorganized, or you under specify and some cases are not considered at all... The result in either case is always buggy code that crashes. It becomes like a virus. Other lesser programmers are afraid to fix it, because it's so complicated. Instead, they just tweak the mess to accomplish their own goals, adding more bad boolean logic along the way. It infects everything it touches.

Finally, certain fields of programming, like machine learning, are almost entirely math and statistics. So, yeah, you don't need math to (poorly) do programming (in certain fields).

Re: Programming is not math

#44

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 operatio…

Link for the curious:

http://homepages.inf.ed.ac.uk/wadler/papers/frege/frege.pdf

Re: Programming is not math

#45
"Mathematics is a language plus reasoning; it is like a language plus logic. Mathematics is a tool for reasoning."

-- Richard P. Feynman, The Character of Physical Law

Programming and Mathematics are both language + reasoning. So we can't say programming is language thus Programming is not math.

Re: Programming is not math

#46
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…

At the post-secondary level, If you get stuck, to the point where you can't figure something out by asking intelligent questions or reading relevant reference material, then you don't belong there. Your journey should have stopped at high school. Maybe sooner.

Professors are not teachers, and they shouldn't be. They are there to expose you to knowledge and you are there to absorb it and expand on it if you can.

Don't go to university to get a degree so you can get a job. Go because you want to learn. If you do it for any other reason you're going to end up in debt and disappointed.

The commercialization of higher learning has perverted it. They encourage people with poor life planning skills to pursue degrees that just leave them poor and bitter.

Re: Programming is not math

#47
Programming for the most part is about understanding program structure and modifying the said structure.

Different people view programming very differently. For example for me programming is mainly a way to understand things. I program things I want to learn about. My understanding of programming helps me understand computers and computing. Then I have a friend who couldn't care less about how exactly things work under the hood, or in theory. All he cares about is making a product, and programming is his tool.

There's a vast difference between computer science and software engineering. I'm afraid most people with CS degrees, let alone those who want to get one, don't even understand this themselves.

Re: Programming is not math

#48
post #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…

Programming should be a tool that supports exploration in other subjects, yes it can be its own subject, but that shouldn't be the core focus.

Re: Programming is not math

#49

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 operatio…

There is massive correspondence between the two and that research is a dominating theme in branches of intuitionistic logic and type theory!

Re: Programming is not math

#50

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 operatio…

I haven't read Wadler's paper, so he may well refer to this, but he relation between programs and proofs generally falls under the well-known Curry--Howard Correspondence[1], Curry being, of course, Haskell Curry, namesake of the language and the practice of Currying.

[1]http://en.wikipedia.org/wiki/Curry%E2%80%93Howard_correspond...

Post reply on HN