Live data from Hacker News

Why do most programmers work so hard at pretending that they’re not doing math?

richardminerich.com

51–60 of 74 posts

Re: Why do most programmers work so hard at pretending that they’re not doing math?

#51
post #45

Earlier quoted context omitted.

I disagree. Generally I see this problem when trying to program in a functional languaged with an imperative thinking. This is not a weakness of the language, but of the developer. I think the hunch of the original article is that few programmers understand the correlation between math and software, hence the lack of use.

Then show me a counter example and by that I mean name a specific, complex, in-production project written in a functional language. Also, can you define "this problem" because I'm not sure which one you are referring to.

Pressed reply instead of the word correction.

Calculus should change the way you understand and perceive the world around, if it didn't, either you got bad teachers and need to ask for your money back, or you were studying only for the test.

And there are a lot of examples, but you can see that AFTER you understand and apply the math behind the concept. Getting by without it is not a proof of its futility, it is only a defense mechanism of the ego.

Re: Why do most programmers work so hard at pretending that they’re not doing math?

#52
post #45

Earlier quoted context omitted.

I disagree. Generally I see this problem when trying to program in a functional languaged with an imperative thinking. This is not a weakness of the language, but of the developer. I think the hunch of the original article is that few programmers understand the correlation between math and software, hence the lack of use.

Then show me a counter example and by that I mean name a specific, complex, in-production project written in a functional language. Also, can you define "this problem" because I'm not sure which one you are referring to.

The problem... Models are brittle. If they are, then they are not complete enough.

Re: Why do most programmers work so hard at pretending that they’re not doing math?

#54
>>> 1.1+2.2 == 3.3 False

Requesting the database with some SQL inner join should get you less lines than both tables ? No ! It gets you a deadlock exception because some other program locks you...

Doing a DNS query to get IP address of an host ? Getting an IP ? Yes ? Everything ok ? No because some bit flipped somewhere and caused the result to be the IP address of foogle.com

So yes you are using maths but you are not doing maths.

Re: Why do most programmers work so hard at pretending that they’re not doing math?

#55
post #45

Earlier quoted context omitted.

I disagree. Generally I see this problem when trying to program in a functional languaged with an imperative thinking. This is not a weakness of the language, but of the developer. I think the hunch of the original article is that few programmers understand the correlation between math and software, hence the lack of use.

Then show me a counter example and by that I mean name a specific, complex, in-production project written in a functional language. Also, can you define "this problem" because I'm not sure which one you are referring to.

If you mean functions are first class and lambdas exist, any project written in Ruby or Javascript.

Re: Why do most programmers work so hard at pretending that they’re not doing math?

#56
post #8

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

Agree 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')".

Re: Why do most programmers work so hard at pretending that they’re not doing math?

#57

A seductive idea, but ultimately of stunningly limited use in software engineering. By far the most costly defects in software creation are due to incorrect requirements or poor systems design. Knowing with mathematical certainty that your software component does exactly what you have specified it to do helps little when what it does is still the wrong thing. And that doesn't even touch on the fact that crafting comp…

Absolutely. Most of the code being produced around me is of the "When button X is clicked, send an XML message to service Y letting it know the contents of textbox Z." I'm sure this can be modelled mathematically, but I'm not convinced this would help.

"""I'm sure this can be modeled mathematically, but I'm not convinced this would help."""

Why would a mathematically modeled system of key-value observing would not help? For one, it would enable one to prove and examine all kinds of assumptions about the model working correctly.

Re: Why do most programmers work so hard at pretending that they’re not doing math?

#58
post #49

Earlier quoted context omitted.

Absolutely. Most of the code being produced around me is of the "When button X is clicked, send an XML message to service Y letting it know the contents of textbox Z." I'm sure this can be modelled mathematically, but I'm not convinced this would help.

I'm not sure. The OP raise the fact the SQL is modeled after set theory. I happen to have learnt set theory a very long time ago, and to use SQL as much as any web developper around. Then I read a book about foundations of SQL, and found out it can and should be seen as an implementation of the set theory. And you know what? It was like a revelation to me. It is incredibly helpful. And, by the way, it make me laughin…

"""because MySQL is sadly /not/ a correct implementation, while PostgreSQL is"""

Of SQL maybe, but of Relational Algrebra/Set Theory, neither PostgreSQL is.

Re: Why do most programmers work so hard at pretending that they’re not doing math?

#59
post #44
post #38

"This is also why programmers who use typed functional languages frequently brag about their low bug count yet eschew methodologies like test driven development: tests pale in comparison to the power of actual models." I've written complex systems. Games. Graphics modelling tools. Network game engines. I've seen a lot of code. I've never seen anything that complex written in a functional language. Why? My hunch is th…

I think the point is that there's something intrinsically verifiable about a mathematical model since you're dealing with quantifiable output. Other cases I can think of are systems where high-throughput or low latency are major requirements but there aren't many of those. Most of what we do is about getting more users or making more profit - good engineering performance and decisions are not directly related to thes…

"""Other cases I can think of are systems where high-throughput or low latency are major requirements but there aren't many of those."""

Actually, I haven't met many cases of systems were high-throughput or low latency are NOT major requirements.

Sure, you can wait for your admin script to do something for half an hour, if it means you get to write it in, say, Python, over some faster language. But you don't want to wait for most things, including most end user software. Here's a list people complain all the time about the slowness of:

1) text editors, programmer editors etc. 2) spreadsheets 3) media players 4) compile times 5) image editing programs 6) web pages/apps 7) mobile apps 8) games 9) file managers 10) IDEs 11) video/multimedia editing 12) sound editing 13) word processors 14) window management 15) databases 16) ftp 17) file management 18) asset management 19) browsers

If there's a program for something, there are people complaining it's slow/bloated.

Re: Why do most programmers work so hard at pretending that they’re not doing math?

#60
post #56
post #8

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

Agree 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') t…

Exactly. 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.
Post reply on HN