Category Theory is like Java

People often think category theory is exotic, or something new, and people often present category theory in this way too. I think that sometimes that can put people off category theory; they think it is some gamble; an untested paradigm. However, category theory as a mental technology has been around longer than anything resembling a modern programming language,[1] and I claim that the reasons for using category theory are more similar to reasons for using a boring technology like Java than they are to using, say, some hot new functional programming language.

For one, just as Java is “write once, run anywhere”, category theory is “prove once, apply anywhere”. People use Java because they can be confident that their software will remain runnable and deployable on any machine, years in the future. Category theory has similar staying power; once you understand something via category theory, you can be confident that the insights you derived will survive the test of time, and also be applicable to new theories in the future. I learn what a monad is once, and then I don’t have to waste my time constantly relearning bespoke interfaces that I’ll never use again.

This is partially a result of a feature category theory and Java have in common: encapsulation. When I work in category theory, I’m insulated from the specifics of my domain and I just interact with it through a well-specified interface, just like how I can’t access fields marked private in Java.

Like Java, category theory has support for a wide variety of uses, and moreover whatever you want to do, you can be pretty confident that there are battle-tested libraries/theories worked out, which will also be compatible with each other. I have good mental frameworks for geometry, algebra, analysis, topology, programming languages, combinatorics, etc. all in category theory. And just like you can usually find the answer to a Java question on stackoverflow, you can usually find the answer to a category theory question on nlab.

Finally, Java and category theory are both platforms with a deep talent pool. I can be confident that if I am using category theory, then I am speaking a language that many other people speak. And onboarding other category theorists to my project is easy; I can normally describe what I’m doing in a couple sentences and they will get the general gist, even if they normally use category theory in a completely different way.

Sure, it takes some effort to get started with category theory. But ultimately as an engineer, I need to pick a conceptual tool that is reliable and will get the job done over and over again, and for that reason I stick to it. It’s just not worth the time to try and work outside of a well-understood and supported platform.


  1. Unless you count lambda calculus, and in that case I would say that you would have to count Emmy Noether’s work as “proto-category theory” ↩︎

4 Likes