Live data from Hacker News

Striking parallels between mathematics and software engineering

radar.oreilly.com

1–10 of 36 posts

Re: Striking parallels between mathematics and software engineering

#2
Linear algebra got a lot easier for me when I realised that matrices are just linear functions, and matrix multiplication is function composition.

Abstract algebra and category theory give you incredibly useful program and API structuring techniques; you can get lots of nice properties for free by following these well-worn existing patterns, even more so than OOP design patterns. We make use of them a lot in Haskell, but they’re basically language-agnostic.

Even simple algebraic manipulations, like noticing that “return” is distributive over a conditional:

    if x then return y else return z

    return (if x then y else z)
Are very useful for restructuring programs to be more readable.

Re: Striking parallels between mathematics and software engineering

#3

Linear algebra got a lot easier for me when I realised that matrices are just linear functions, and matrix multiplication is function composition. Abstract algebra and category theory give you incredibly useful program and API structuring techniques; you can get lots of nice properties for free by following these well-worn existing patterns, even more so than OOP design patterns. We make use of them a lot in Haskell,…

There's also this:

http://www.haskell.org/haskellwiki/Curry-Howard-Lambek_corre...

Re: Striking parallels between mathematics and software engineering

#4
This is why one of the most valuable uses of time for mathematicians and especially software engineers is to study the historical development of techniques and technologies. Understanding how matrices are a product of the quest for finding solutions to systems of linear equations gives you a much better idea for when and how to apply matrix techniques. Most math textbooks limit themselves to "The determinant is defined by ad-bc" which on its own is an almost completely useless fact to know outside of taking an exam.

Software engineering is much worse in terms of useless complications developed by people who don't know previous solutions (angular.js? Great! Have you ever heard of dataflow programming? Constraint satisfaction? Dynamic binding? No? No wonder angular is such a piece of shit).

Re: Striking parallels between mathematics and software engineering

#6
It wobbled around a little bit but the main idea that mathematics like software is a human construction and that just like all human constructions it is susceptible to encoding historical accidents as truths is a good point.

The other theme in the article about algebra and minimally acceptable abstractions for accomplishing a goal is unfortunately nowhere to be found in software.

Re: Striking parallels between mathematics and software engineering

#7

There's a concrete object-oriented Python implementation of much of abstract algebra is Sage. You can see some of that here: https://github.com/sagemath/sage/blob/master/src/sage/struct... (Disclaimer: I'm a Sage developer.)

That's pretty interesting, thanks for sharing.

Re: Striking parallels between mathematics and software engineering

#8
Interesting. While I agree with the general premise (a lot of mathematics is a human-made construction), the concrete examples she provided feel somewhat forced. Especially the comparison to OOP - I personally don't see how it adds to understanding the various subdivisions defined by abstract algebra.

Re: Striking parallels between mathematics and software engineering

#9
I've just started reading http://en.m.wikipedia.org/wiki/Where_Mathematics_Comes_From

It's about math as a human construction. Very comforting to see ones inner metaphores and mental models of math "legitimised" and exposed in a scientific framework. One could hope for a companion: Where Software Engineering Comes From.

Re: Striking parallels between mathematics and software engineering

#10
If you can find a way to get a hold of it, Saunders MacLane's Mathematics: Form and Function is a tremendous book for understanding how math arises from the world and reflects it. What's written here is a lot more specific than that, of course, but if this illustration interests you then it might be a good book to try digging into a little bit.

On the other hand, while I am always cognizant and amazed by the POV of math as a human construction, there's something a little otherworldly about it from time to time. In the same way that you sometimes hit a code design which feels so damn good, Math, especially older math, is just a huge collection of these. Somehow, despite this all coming, apparently, from our minds, we hit on these design decisions that are just so sweet that they last millennia. This is what inspired things like Voyager---maybe it's hubris, but it just has to be the case that aliens speak mathematics.

So, I encourage anyone excited by this: math isn't "hard", it's just big and wonderful. You'll never finish learning it, but the journey will be incredible.

I'll leave this linking two more great resources (edit: to be clear, really the first one is the great resource... the second is just me talking, not really great at all). First, Paul Erdös, a famous mathematician who perhaps specialized in combinatorics, loved this idea I espouse above. In his mind, God had a small number of "proofs" in his mind when he designed mathematics. These are so wonderful that their beauty is completely self-evident. After Erdös "stopped doing math" (passed away) people compiled some of his Proofs from The Book along with others they imagine he would have so regarded into a great text book called, unsurprisingly, Proofs from The Book [0].

Finally, I'll self plug a little essay I wrote, actually in another HN comment, a while ago about learning mathematics.

http://jspha.com/posts/there_is_no_royal_road_to_mathematics...

[0] http://www.amazon.com/Proofs-THE-BOOK-Martin-Aigner/dp/36420...

Post reply on HN