Tuesday, 1 September 2015

soft question - How Does Math Relate to Programming?

The practice of object-oriented programming requires understanding of levels of abstraction which are made explicit in category theory. This does not mean that the way a computer scientist views object-oriented programming is similar to the way that a category theorist views category theory, but there are strong superficial similarities on lower levels.



Both subjects have objects, and these are analogous. There are things you can do with the objects called methods in OOP, and morphisms in category theory.



Classes in OOP may roughly correspond to categories in category theory.



Inheritance and polymorphism can be related to some functors in category theory.



Does that help you to program better? I'm not sure, but if you haven't encountered category theory yet, you may find it more approachable due to your OOP background.



Here are a couple of related MO questions:



Relating Category Theory to Programming Language Theory



Programming Languages based on Category Theory

No comments:

Post a Comment