Skip to content

What Every Programmer Needs to Know About Category Theory

13 Comments

  1. Vijay Santhanam wrote:

    Nothing? How poignant

    Friday, January 18, 2008 at 12:22 am | Permalink
  2. javajosh wrote:

    Clever.

    Friday, January 18, 2008 at 12:56 am | Permalink
  3. Pseudonym wrote:

    True enough. Only good programmers need to know about it.

    Friday, January 18, 2008 at 1:08 am | Permalink
  4. nec wrote:

    umm, was that supposed to be an ironic joke?

    Friday, January 18, 2008 at 1:26 am | Permalink
  5. Arjang wrote:

    Is this a joke? I cant see any content. I am using IE 6.

    Friday, January 18, 2008 at 4:56 am | Permalink
  6. S. wrote:

    Nothing? :)

    Friday, January 18, 2008 at 6:40 am | Permalink
  7. Oliver wrote:

    @nec, @Arjang: yes, nothing; sorry, it was intended as a joke, not a trick.

    @Pseudonym: Congratulations on catching the subtleties in the title (“every programmer” versus “some programmers”; “needs” versus “should”). Nonetheless, I’m curious as to whether knowing category theory helps anyone program. The parts of category theory that relate to programming (functors, isomorphisms, monads and co-), I realized I was able to understand by using specific programming constructs as examples, and that knowing their categorial expressions didn’t lead me to think about them any more deeply or to find analogies or solutions (the way that, say, realizing that you’ve implemented a state machine, or that your problem can be expressed in linear algebra, do).

    And I haven’t been able to apply the other parts of category theory to programming at all, although I’ve found them incredibly useful in doing, and teaching, math, and in thinking about other activities such as project management and other aspects of life. The Yoneda Lemma, for example, says that you aren’t lost if you can find a landmark that you can get home from. (Think about it :-)

    Friday, January 18, 2008 at 8:47 pm | Permalink
  8. Pseudonym wrote:

    Oliver: Category theory is to mathematics what design patterns are to software engineering (which is not, of course, what “every programmer” does).

    In software engineering, if a pattern shows up in several applications, we give it a name so we can talk about it independently of any single application. Same with category theory. Initial objects, products, equalisers and so on are names of patterns which turn up in a lot of algebras.

    One thing that I see a lot is that programmers come out of university with a lot of knowledge about how to implement a function/procedure/whatever, but almost none about how to implement the interface. Making things worse is the problem that an interface is harder to change than an implementation. It’s more important that you get it right early.

    One theme that I’m seeing is that the best interfaces, the best APIs, are the most “mathematical”. Even simple things, like binary search trees, are simpler to implement and use if you think about them algebraically. Even some .NET APIs are using monads in anger these days.

    Yes, you could come up with that without knowing any category theory. However, category theory is another tool in the programmer’s toolbox that can be used to talk about, understand and ultimately solve a problem.

    Monday, January 28, 2008 at 10:07 am | Permalink
  9. Dub wrote:

    What .NET API is using Monads? (My googling is swamped by the Powershell use of the term).

    Monday, February 4, 2008 at 6:20 pm | Permalink
  10. Seems as tho there is no text under this article? i’ll try again later..

    Sunday, May 4, 2008 at 3:46 am | Permalink
  11. HAHA

    Sunday, July 6, 2008 at 5:38 am | Permalink
  12. I am using Fire Fox 3.0 and i can’t see a thing either ^^

    Monday, July 21, 2008 at 7:02 am | Permalink
  13. I am using Fire Fox 3.0 Final, and besides the title I can’t see a thing either ^^

    Tuesday, July 22, 2008 at 4:59 am | Permalink