7 ms·
Working as a SWE for lots of years, I've worked with people that always feel the need to "add a level of abstraction" or "build a framework" for (and out of) ev
by timmg 4y ago
Working as a SWE for lots of years, I've worked with people that always feel the need to "add a level of abstraction" or "build a framework" for (and out of) everything. A lot of the time it doesn't make things better (and often makes things worse).
Every time I try to learn about Category Theory, I get to a certain point and just start wondering "why?"
I can't tell if I'm not smart enough to get it (I think that's the most likely answer). But it feels like some math people -- who have nothing better to do -- are just trying to create another level of abstraction.
Are there things that Category Theory does that other branches couldn't already do? I'm curious to hear other takes on this.
- dr_kiszonka 4y agoI can't answer your question in terms of pragmatic applications. Based on skimming this book and similar resources posted on HN, my -- naive, I am sure -- understanding is that category theory unifies other theories and serves as a glue. One example from the linked book, "Remember that we said that programming types (classes) are somewhat similar to sets, and programming methods are somewhat similar to functions between sets, but they are not exactly identical? A formal connection between the two can be made via category theory."
- adamnemecek 4y agoIt's a general scaffolding that can be shared between branches of math.
- resource0x 4y agoBetween some branches of math. And you have to be familiar with these branches of (graduate level) math to appreciate it. Learning category theory in isolation will leave you baffled. Why it's being constantly pushed on HN is beyond me.
- gryn 4y ago> Why it's being constantly pushed on HN is beyond me. the answer is haskell
- dimitrios1 4y agoAnd that's a fine enough reason. Sometimes learning assembly leads people to learn about electrical engineering concepts, and boolean algebra. Sometimes writing algorithms that need to be efficient leads people to learn about number theory. Sometimes people trying to develop a really effective database schema get interested in set theory. These are good things.
- epgui 4y agoExactly, and it's supposed to be what this forum is all about: intellectual curiosity and (to some degree) interdisciplinary knowledge-sharing! It drives me nuts that the anti-intellectual stance is so prevalent.
- resource0x 4y agoI actually put some effort in learning it, and found it intellectually empty. If you find it enlightening - good for you. :-)
- epgui 4y agoYou must have an interesting definition of "intellectual" lol...
- gryn 4y agoI agree, just pointing out the reason/gateway drug.
- wisnesky 4y agoIf you have a symmetric system, you can use group theory to make predictions about it. Similarly, if you have a compositional system, you can use category theory to make predictions about it. As for whether those predictions are useful, or non-obvious, or worth it, etc, tends to very a lot depending on the application, and the other techniques available- it's not a matter of being smart enough to get it. FWIW, I think category theory is certainly indispensable in denotational programming language semantics.
- School-Cotton 4y agoCategory theory has virtually zero application to software engineering. Abstract algebra (knowing what a group, monoid, etc. are) has a bit more practical application. Knowing what a monad is (in the programming sense) has some as well. Neither of the latter two require learning category theory.
- francogt 4y ago> Category theory has virtually zero application to software engineering. > Knowing what a monad is (in the programming sense) has some [practical application]as well. You’re contradicting yourself. You don’t need to know category theory to use practical abstractions like functors and monads. They are still however category theoretical concepts. If these category theoretical concepts have “some practical application” as you say, then category theory does have application to software engineering.
- School-Cotton 4y agoIt had application in the sense that it provided inspiration for these concepts, yes. However learning anything else from category theory is irrelevant to understanding and using them.
- proc0 4y agoCT describes type theory really well, which is used in a lot of programming languages. Monoids and Monads come from CT, and their implementation doesn't really explain what the concept really is (it kind of does, but not really). The programmer might not need to learn CT, but it helps to have broader understanding of how the underlying rules of the language are working.
- School-Cotton 4y agoMonoids do not come from category theory, they come from abstract algebra. How does category theory “describe type theory” ?
- 4y ago
- pohl 4y agoMathematics, at its foundations, loves to see how much they can get with the smallest number of concepts and assumptions. It’s good to learn what’s really necessary.
- deleted 4y ago[deleted]
- hermitcrab 4y ago>Working as a SWE for lots of years, I've worked with people that always feel the need to "add a level of abstraction" or "build a framework" for (and out of) everything. You might be interested to read Spolsky's essay on 'architecture astronauts': https://www.joelonsoftware.com/2001/04/21/dont-let-architecture-astronauts-scare-you/ https://www.joelonsoftware.com/2001/04/21/dont-let-architect...
- nuancebydefault 4y agoVery funny to read, especially because it feels outdated. "With this new architecture we cannot simply..." years after we can say we can! Edit - "No, Sun, we’re not going to be able to analyze our corporate sales data “as simply as putting a DVD into your home theatre system.”" is what I am talking about
- hermitcrab 4y agoIt was written in 2001. But the architecture astronauts are still with us.
- l__l 4y agoSo I come at this from a mathematical background --- graduate student in categorical algebra --- but I've done a couple years of SWE work, so I'm not unsympathetic to this point of view. The way I see it, when you want to reason about things like data processing (which is what a massive chunk of writing software is, moving data from form A to form B), category theory provides what is in some sense the "correct" language/framework in which to think. It's not just an abstraction circle-jerk, it's a genuinely useful perspective, particularly for guiding your mind to spot non-obvious connections between pieces of code. The problem as I view it is that CT is first and foremost a discipline of maths. It was developed to help mathematicians, is very sophisticated, and very specialised; learning CT for SWE is taking a sledgehammer to a nut. I can't honestly recommend it as a field of study to someone who isn't interested in the problems it was developed to solve. If you don't have a solid grounding in set theory, logic, algebra, topology, etc., it's a very tough field to motivate. The vast majority of CT is of little to no relevance for SWE work. Adjunctions, for example, are absolutely fundamental to all of maths, but in truth are not really relevant for SWEs. As a result, you see people trying to teach concepts like monads without reference to them; this is slightly insane from where I'm standing... Your question about whether there are things CT does that other branches didn't already do; one of the fundamental utilities of CT in pure mathematics is "making trivial things trivially trivial". That is to say, it makes it very clear which parts of your problem are local to your specific situation, and which are purely "structural" from the categorical constraints. The SWE analogy would be separating business logic from other layers. So at least for mathematicians, it absolutely does have novel utility, and has drawn links between a huge number of disparate studies that were not well-understood previously. So if you _do_ care about posets and groups and cohomology theories, CT will genuinely open your eyes, and (albeit, this coming from someone with less working experience than yourself) it could give you a deeper, or at least different understanding of the code you're writing. Otherwise, I'm not sure it's worth putting yourself through it, tbqh. (If you do decide to give it another go, please use a better resource than the linked post; after a quick scan it looks pretty weak)
- skrtskrt 4y agoI think this is a good perspective - it follows the general approach in software engineering that if you're going to introduce something with a massively different approach, learning curve, and cost of adoption, it needs to come with the associated real-world benefits. For most software stuff it would be very hard the benefit of introducing this stuff vs. what the standard paradigms that everyone already knows
- bmacho 4y ago> Every time I try to learn about Category Theory, I get to a certain point and just start wondering "why?" > I can't tell if I'm not smart enough to get it (I think that's the most likely answer). But it feels like some math people -- who have nothing better to do -- are just trying to create another level of abstraction. > Are there things that Category Theory does that other branches couldn't already do? I'm curious to hear other takes on this. No, category theory was not created for the sake of an another level of abstraction. It was created to talk about algebraic topology. I am not sure if you gain anything studying that. Probably you won't but who knows. (But I am thinking more and more that CT advocates are harmful, they trick people to dive into CT which just steals their time, and gives them nothing.)
- maxiepoo 4y agoIt sounds like category theory likely has no direct impact on your life. So you can move on. But please do not let this bleed into a criticism of category theory as used in mathematics. Category theory from the very beginning was developed to help manage the complexity of modern mathematical fields like algebraic topology. It was then famously used by Grothendieck in algebraic geometry where some of the basic notions (schemes) were defined in terms of category theoretic concepts (functors). It's been applied to many other fields, since, including yes computer science, and mainly for the same purpose: giving precise terminology to common patterns (monads functors etc) and giving us the right concepts to design new functional programming languages. As someone who is an expert on these topics I find some of the popular sentiments about programmers using category theory to be a bit silly, but I'll admit it's overall probably good for my field because it cultivates a lot of interest in students. It probably plays a similar role to pop science/math in other fields: not very deep but fun and can be a gateway to "the real thing". The popular perception of category theory is a bit bizarre to me though. It is a beautiful theory with many useful results. But you don't see the same excitement or resentment towards fields like order theory or abstract algebra, which are very closely related to, and just as abstract as, category theory and are used in similar ways.
- dimitrios1 4y agoWhat is your recommendation for learning? I've been recommended Bartosz Milewski enough times, and started to dive in. I am not interested in learning the totality of Category theory, just enough to be more effective in FP languages like Haskell.
- cfiggers 4y agoHave you been recommended his blog series/book only, or the playlists on YouTube as well? I really like his recorded lectures on YouTube and they cover similar ground in a similar order to the blog posts (from what I've read—I'm further into the YouTube series than I am his written material).
- deterministic 4y agoCategory Theory will not make you more efficient in FP languages like Haskell. I studied it enough to realise that it doesn’t give me any insights or thinking tools I can actually use to write better software. However I highly recommend reading “Software Foundations”. It is almost guaranteed to make you better at writing software in any language. Including Haskell. That’s what happened to me.
- epgui 4y agoWhy are we not all downvoting anti-intellectualist comments like this? The odds that a whole discipline of mathematics is "of little use" or "nothing more than an inappropriate abstraction" is basically nil. I see little difference between this comment, and a comment that calls sociology or philosophy useless. No sympathy from me!
- thfuran 4y agoWhy? For a lot of mathematicians, work being of practical use isn't even a consideration. I know math professors who would freely tell you that they were never aware of any application for their PhD work and never cared, because it was interesting. A lot of math does have a lot of useful applications, and there certainly are applied mathematicians, but it is not, on the face of it, absurd to suppose that there are areas of math with little to no known practical application.
- epgui 4y ago> I know math professors who would freely tell you that they were never aware of any application for their PhD work and never cared, because it was interesting Exactly, but that's the opposite of an anti-intellectual attitude. It's not anti-intellectual to engage with pure maths-- on the contrary lol! What's anti-intellectual is to say that if you can't see the value of maths, that it's not worth engaging with. You'll never see the value of anything if you don't engage with it, and also I'm pretty sure that by now people shouldn't need any convincing that maths is worth learning. And when I say "engage with maths" I don't mean "I read an article or a book once but I didn't get it so I decided that it wasn't worth the time".
- timmg 4y agoSorry if I offended your sensibilities. Feel free to downvote my comment if you don’t think it adds to the conversation. I would appreciate, though, if you didn’t misquote my comment when replying to it. Neither of the things you have quoted are things I wrote. Worse, they are a misrepresentation of my comment.
- agentultra 4y agoYou haven’t taken the time to understand it, therefore it must be useless. Others who practice it must be doing useless things. This seems like a common solipsism among software developers. The problem with your definition of abstraction is that you’re thinking of indirection. Abstractions in mathematics create precise definitions with provable laws. When you have a proof of a theorem you can ignore the details underneath and think in terms of the abstraction. I wouldn’t be so cavalier about dismissing category theory. It’s interesting for many reasons but it’s not here to serve you. You could find ways that it can improve your programs and how you think about them, as others have, or you can get on without it. And that’s fine too!
- mirekrusin 4y agoThey just want to articulate levels of abstractions for abstractions.
- proc0 4y agoAbstraction is powerful. It lets you control more with less. As you keep abstracting things get complicated. Category Theory studies abstractions and lets you build extremely abstract systems, which can be leveraged to create reliable and also flexible systems. The downside is of course the learning curve, and because of this it isn't as friendly for business and teams to use. In an ideal tech industry (in my opinion), engineers are encouraged to persue the most complicated engineering, despite the rest of the company having very little idea of how it works. It would require a lot of trust, and also a different work ethic, but I digress.
- HervalFreire 4y agoIt just hasn't clicked for you yet. I wouldn't call it "another level of abstraction" It's more of a "fundamental theory of abstraction". Once it clicks you can see it. And you will see all the design patterns and abstractions you see in books like the gof are the ones that are "arbitrary layers of abstraction" That's why a lot of programmers want to incorporate the concepts into their languages. Because once it clicks you realize that all other abstractions (especially design patterns in oop) are flawed and wrong. You start to see cracks and broken abstractions everywhere. This is not just another GoF design patterns thing. It's fundamental. But the thing is it's so hard usually if you get it, you'll be living in a world where most people don't get it. So people will have trouble understanding you. If you don't ever get it, I would view it as a layman would view quantum physics or general relativity. You know it's a more fundamental description of the universe but you just can't grasp it.
- deterministic 4y agoYou are most definitely smart enough. And your instincts are correct. Category Theory is not an efficient thinking tool for thinking about software. You can use it for that of course (monads were originally modelled in CT) but there are much better tools out there that will get you there faster (Abstract Algebra, Reduction Machines and State Machines for example). There are a few (usually Haskell) people that love to make claims about the need for you to learn CT. They are wrong. It’s that simple.
- mrkeen 4y ago> I've worked with people that always feel the need to "add a level of abstraction" or "build a framework" for (and out of) everything This is my experience with the Java folk, and they're certainly not being inspired by category theory. Indirection isn't abstraction. What I usually come across is someone wanting to make a REST POST, but they wrap it in a networkconnection in a networkclient in a networkworker in networkmanager, which can only be instantiated by a network factory. CT-thinking (not that I've studied any) is more like: a POST is an arrow from request to response. Can we join such items head-to-tail? Is it ok to substitute createUser.then(createPassword()) for createUserAndPassword? Can we map over the arrow without unpacking it and repacking it, etc. Have a read of https://www.haskellforall.com/2014/04/scalable-program-architectures.html https://www.haskellforall.com/2014/04/scalable-program-archi...