Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Category theory is to functional/declarative programming what design patterns are to OO programming.

Patterns for decomposing problems and composing solutions.

To ask “How is it useful?” Is to ask “How are design patterns useful in OO?”.

But you already know the answer…

Is there an advantage over just inventing your own vocabulary? Yeah! You don’t have to reinvent 70+ years of Mathematics, or teach your language to other people before you can have a meaningful design discussion.



>You don’t have to reinvent 70+ years of Mathematics

What do those 70 years of mathematics do for me as a software engineer?

>or teach your language to other people before you can have a meaningful design discussion.

It's the other way around. Most engineers will have no clue what you are saying.


>What do those 70 years of mathematics do for me as a software engineer?

You mean other than inventing the entire industry in which you work? It's a weird question that I have no idea how to answer for you.

What is 70+ years of computer science doing for you as a software engineer? Are you standing on the shoulder of giants; or are you inventing/re-discovering everything by yourself from first principles?

>It's the other way around. Most engineers will have no clue what you are saying.

So how do engineers understand each other if we all invent our own meta-language to speak about software design in the abstract?

Misscommunication is what happens by default unless you intentionally become part of a community and learn the meta-language. Mathematics is one such community which has existed for millenia and benefits from the network effect. It's an anti-entropy thing.

There are many parallels here to the Tower of Babel.


>What is 70+ years of computer science doing for you as a software engineer?

No, what does category theory unlock from mathematics that I can not get without it.


Nothing. You can re-invent and re-discover everything. By yourself. From first principles.

You can re-discover and re-invent all of computation, Mathematics and physics.

Heck, you don’t even need computers if you have pen and paper.

You can do absolutely everything all by yourself. All you need is infinite time.


I'm not sure if this is supposed to be sarcastic, but taking it at face value, mathematics are the underpinning of both computer hardware and computer science. Since we are talking about more abstract mathematics, it is what gave us the lambda calculus, complexity analysis of algorithms, type theory, relational algebra, distributed systems.

more pragmatically, libraries like redux, react are heavily influenced by concepts from functional programming, rust has novel concepts from type theory, data engineering in the cloud age leverages a lot of algebraic concepts to achieve massive data throughput. We have parser combinators, lambdas, stronger typing, map and flatmap in most languages these days. These all come directly from mathematics.


>redux, react are heavily influenced by concepts from functional programming

Functional programming concepts don't require learning category theory

>rust has novel concepts from type theory

Type theory isn't category theory. Rust's borrow checker was not inspired by affine types.

https://smallcultfollowing.com/babysteps//blog/2012/02/15/re...

>data engineering in the cloud age leverages a lot of algebraic concepts to achieve massive data throughput

This doesn't requite category theory and those are basic concepts from algebra that you can learn outside of the context of algebra.

>We have parser combinators, lambdas, stronger typing, map and flatmap

These don't require category theory either.


Oh, I thought your point was that mathematics wasn't bringing anything to computers. As far as I understand it, category theory is more about finding commonalities across mathematical fields (or indeed, scientific / engineering fields), more so than solving more concrete problems.

What does that give you? For me, I think it gives me an easier way to see common abstractions across different problems I work on.

I am at the beginning of my CT journey itself, but a layman's understanding of monads, functors and applicatives gets me really far writing pretty much the same code when i do bare-metal embedded or frontend javascript. The point is not that I couldn't write bare-metal code or frontend code without, is that I am much quicker seeing "my javascript promises are like a monad" and "my coroutines are like a monad" and being able to shrink my cognitive load.


>Functional programming concepts don't require learning category theory

This is such a reductionist world-view. Programming concepts don't require you to learn the theory of computation either, but having a theoretical/abstract grounding for what computation is disconnected from any particular programming language/model of computation helps. A lot.

>Type theory isn't category theory

It depends on what you mean by "isn't".

There is a 1:1 correspondence between type theory and category theory constructs.

https://ncatlab.org/nlab/show/computational+trilogy#rosetta_...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: