Live data from Hacker News

Programming as a Way of Thinking

blogs.scientificamerican.com

71–80 of 133 posts

Re: Programming as a Way of Thinking

#72
post #22

This article starts to get at an idea that I've had for a while now -- that mathematicians are doing it wrong. In the software business we learned a long time ago to name our variables properly, name our functions logically, and to control complexity by breaking ideas into modules and then hiding the details inside. If you can't name something, then you don't know what it is, and that tells you that you should rethin…

It's more standard than people realize. Offhand: x: "some real-valued variable" n: "a countable quantity, usually a total" i: "an index" k: "some kind of constant", often an integer, whose value doesn't change, "c" is also used for this e: almost never used as a variable, it's Euler's number p: some kind of probability, or a prime number, along with p and q t: some kind of parameter, often goes from [0,1] or (0,1) z:…

The letter "e" is often used as a generic edge name in a graph. Usually "v" is for vertex in that context.

Re: Programming as a Way of Thinking

#73
post #44
post #22

This article starts to get at an idea that I've had for a while now -- that mathematicians are doing it wrong. In the software business we learned a long time ago to name our variables properly, name our functions logically, and to control complexity by breaking ideas into modules and then hiding the details inside. If you can't name something, then you don't know what it is, and that tells you that you should rethin…

This article starts to get at an idea that I've had for a while now -- that mathematicians are doing it wrong. And you're making a typical programmer mistake in thinking that. Programming is geared towards having people who are experts in programming, but not in a specific subject area, be able to develop and maintain code. Therefore practices like descriptive variable names help provide context to people who cannot…

True, much of math is relegated to experts. This is _exactly_ the problem. Why do you think so many adults have such little understanding of math and will proudly proclaim that they haven't used algebra or geometry in their adult life?

Yes, there are are some areas of mathematics that are extremely specific and do require experts but a lot of math is useful to people in general and anything we do to make it easier for a new person to learn is something that will help the average person use it and will also make it easier for new people to enter the field.

Re: Programming as a Way of Thinking

#74
post #44
post #22

This article starts to get at an idea that I've had for a while now -- that mathematicians are doing it wrong. In the software business we learned a long time ago to name our variables properly, name our functions logically, and to control complexity by breaking ideas into modules and then hiding the details inside. If you can't name something, then you don't know what it is, and that tells you that you should rethin…

This article starts to get at an idea that I've had for a while now -- that mathematicians are doing it wrong. And you're making a typical programmer mistake in thinking that. Programming is geared towards having people who are experts in programming, but not in a specific subject area, be able to develop and maintain code. Therefore practices like descriptive variable names help provide context to people who cannot…

Yes. As an example of how we programmers are no different than mathematicians, consider terms like "service" (or "data"), which is pretty much our version of the variable "x". Some of the terms in our jargon get used and reused in so many contexts, it must appear nonsensical to an outsider.

Re: Programming as a Way of Thinking

#75
post #37
post #33

Earlier quoted context omitted.

> ... a paper that uses entirely unnecessary equations, and doesn't bother to define symbols. This practice wastes everyone's time. I agree with you there, notation should be defined, otherwise it doesn't help explain anything. However, consider that for people who are already used to the notation those "unnecessary" equations are actually more compact and precise than reading the accompanying text. What seems diffic…

Naming is hard, no question. Context helps, though. In realm where I live, computer science, x, y, and z likely correspond to something in the problem domain, like "rate" or "time". And even if we're dealing in pure, as opposed to applied, math, you should still be able to come up with names like "surfaceArea" or "interval".

So how would you rename a, b, c, x and y in the quadratic formula?

https://en.wikipedia.org/wiki/Quadratic_formula

It is impossible to get better than one letter variable names here. This goes for most expressions in maths, to make things simpler we just use one letter variables for everything. This forces us to learn that the names aren't important, all that matters is how the names relate to each other.

The problem with notation only occurs when non mathematicians start to write down formulas without properly defining what everything is. This is not a problem with mathematical notation, this is a problem with statisticians/economists/physicists/Computer scientists etc who define their own global naming rules where P might denote probability/price/momentum/polynomial time problems etc.

Re: Programming as a Way of Thinking

#76
I agree partially with this article. I think programming in a highly expressive language and runtime is a great way to get started exploring and develop intuition. I solved differential equations using mathematica in middle school, long before I even learned how to integrate. I solved instances of the traveling salesman problem long before I understood how complex it is. I played around with images and video files long before I learned anything about signal processing. I find that it is very helpful as a student to be able to learn from bottom up and top down simultaneously. Mathematica is much more forgiving than python if a student has no prior programming experience.

Re: Programming as a Way of Thinking

#77
post #22

This article starts to get at an idea that I've had for a while now -- that mathematicians are doing it wrong. In the software business we learned a long time ago to name our variables properly, name our functions logically, and to control complexity by breaking ideas into modules and then hiding the details inside. If you can't name something, then you don't know what it is, and that tells you that you should rethin…

Mathematicians work with pen and paper regularly. So long var names can be frustrating. If everyone goes to digital format it may be easier.

However, there are forces working against that. Mathematical proofs are more like sentences, or even poetry, than a structured language that can be compiled. They are meant for humans to read. So you jot down your proof over and over again in different formats, playing with both the logic and also the visual representation.

Another issue is that a lot of math is done just in your head, so you don't need a computer at all. When writing code you inherently need to test the codes execution, and also more frequently reference digital materials in your research.

Re: Programming as a Way of Thinking

#78
post #65

Earlier quoted context omitted.

This notation has developed over tens to hundreds of years before we had the capabilities of autocomplete and formal typing where a computer can help us write longer names more quickly. This is why single letters became prominent, they were simply easier and faster to write. But anyone who is serious about writing maintainable code today should be using an IDE where the benefits of susinctness are entirely relegated…

It's actually the other way around. Mathematical notation used to be very much language-like and tedious to read. As time went by (and math became more complicated) notation was developed to make it more succinct and easier to understand. (And sometimes the more succinct notation helps to develop new insights. The change from Roman to the Indian/Arabic number systems made calculations easier for everybody) https://en…

Conversely, you just draw a picture and leave all of this tedium behind, making the import of what you are talking about obvious at a glance.

Re: Programming as a Way of Thinking

#79
post #78
post #65

Earlier quoted context omitted.

It's actually the other way around. Mathematical notation used to be very much language-like and tedious to read. As time went by (and math became more complicated) notation was developed to make it more succinct and easier to understand. (And sometimes the more succinct notation helps to develop new insights. The change from Roman to the Indian/Arabic number systems made calculations easier for everybody) https://en…

Conversely, you just draw a picture and leave all of this tedium behind, making the import of what you are talking about obvious at a glance.

Proofs by picture arent proofs though. And how would you even convey by picture that two line segments are of the same length. Or that if you drew C and D as separate points they turn out to be the same point?

Re: Programming as a Way of Thinking

#80
post #22

This article starts to get at an idea that I've had for a while now -- that mathematicians are doing it wrong. In the software business we learned a long time ago to name our variables properly, name our functions logically, and to control complexity by breaking ideas into modules and then hiding the details inside. If you can't name something, then you don't know what it is, and that tells you that you should rethin…

Thank you for writing a terrific criticism on how math is taught today.

In part because it's one of the oldest taught subjects, I think the field has gotten away with how it teaches. In every other field we have an escalation ladder of abstraction that starts from tangible descriptions that a motivated learner could understand all the way up to symbolic jargon that is only accessible to insiders.

Math doesn't have this at all. It goes from arithmetic straight into symbolic manipulation with only a sideways glance at describing three dimensional shapes. It's lazy and the field needs to acknowledge that it has practical dimension as well as a theoretical one and each needs to be taught and described differently.

Post reply on HN