7 ms·
You don't need Category Theory to tell you that there is a duality between structs and unions, any C programmer could tell you that. Mind you I spent a lot of
by justincormack 14y ago
You don't need Category Theory to tell you that there is a duality between structs and unions, any C programmer could tell you that.
Mind you I spent a lot of time working with Haskell in an academic environment and never understood the first thing about category theory. Especially those bloody diagrams that were supposed to be proofs.
It is entirely possible to understand functional programming and abstraction without understanding any category theory...
- j_baker 14y agoI disagree. I think that if you understand functional programming and abstraction, you understand a certain amount of Category Theory even if you don't know to call it "Category Theory".
- lubutu 14y agoAnalogously, "you don't need maths to tell you that one and one is two."
- DanWaterworth 14y agoAs soon as you have an understanding that one and one is two, you have maths.
- Confusion 14y agoThat's bait and switch. The question is whether people should study category theory to be better programmers. Not whether good programmers have intuitively mastered some category theory.
- DanWaterworth 14y agoHow do you know that it's entirely possible to understand functional programming without understanding category theory, when, by your own admission, you "never understood the first thing" about it?
- pessimizer 14y agoHow does he know it's entirely possible to understand A without understanding B, when he understood A, and never understood the first thing about B? Not sure if joking.
- DanWaterworth 14y agoWhat I mean is that it is objectively difficult to know that you understand A. How do you know that understanding B wouldn't give you a greater understanding of A?
- KeithMajhor 14y agoYou could also have some anonymous understanding of B. This reminds me of Richard Feynman's story about his dad and the bird.
- pessimizer 14y agoHe didn't claim that category theory couldn't possibly give him a greater understanding of functional programming.
- bluekeybox 14y agoThen a greater understanding of FP is possible through understanding of CT.
- pessimizer 14y agoThat does not follow from my comment, which takes no stance, but is the thesis of the article.
- DanWaterworth 14y agoIf he'd claimed "I understand CT and it didn't help my understanding of FP in the slightest", I'd have no qualms. The problem I have is, what he's saying is essentially "I don't understand CT, but I'm having no problems with FP without it". Here's an analogy. There's an apprentice carpenter who has been given some tools and as far as he is concerned the tools he has been given are all of the tools in existence. It's quite clear that if he was given a new tool, he could immediately establish whether it was useful or not. He could not establish, however, that he has access to every useful tool. From his account, I don't know whether CT is like a hammer that he is using upside-down (needs explanation before it's useful) or a banana (never going to be useful to construct anything).
- tree_of_item 14y agoNot any C programmer could give an explicit, formal definition of "duality" and show how it applies to structs and unions. So yes, you do need category theory for that.
- DanWaterworth 14y agoBesides, the duality is between structs and tagged unions, rather than C unions.