5 ms·
How important is this to understand in practice for a Scala programmer?
by smegel 9y ago
How important is this to understand in practice for a Scala programmer?
- giomasce 9y agoBasing on how much it is important to understand categories to know mathematics or to know other languages, I would say nothing. But probably it can be fun, and definitely you can then brag about it. However, if you still have to learn X, don't try to learn categories to learn X. First learn X decently, then if you want learn categories (or any algebraic abstractions that people say it is useful) and you have some hope that categories will give you some additional insights on X.
- bad_user 9y agoYou can get by with Scala, or Functional Programming in general, without an understanding of category theory, although naturally some CT concepts will creep into your understanding without you realizing it. Category Theory basically provides a framework for talking about composability in rigorous language. It's important if you want to grok Functional Programming concepts, but you can get by without it just fine.
- yuvalitzchakov 9y agoSince Scala is a hybrid language, you can still program in it and do things as you would do in Java, for example. You will see common patterns emerging, such as seen a `map` method on List, Option, Try, etc.. Now, you could ask yourself "What is this pattern and why do I see it everywhere?", or you can just continue with your life being satisfied with what you know today, and no harm will be done. I've been doing Scala for the past two years, and the amount of things I've learned feels amazing. I've watched (and still am watching) Bartosz Milewskis "Category Theory for Programmers" which takes you from the very fundamentals of CT all the way to things like Adjunctions and Kan Extensions. I find it fascinating.
- sjrd 9y agoI'm the author of Scala.js, so supposedly a Scala "expert", and I still don't understand category theory. Does that answer the question?
- smegel 9y agoIt gives me some idea, yes :)
- usrusr 9y agoNot at all or absolutely essential, depending on wether or not you work with developers (or with their libraries) who use this as the language to talk about code.
- ivanhoe 9y agoMy understanding is that, just like the abstract algebra, category theory is a useful tool to help you recognize patterns and provide you some level of certainty about their behavior. Rather than figuring out yourself if you should do something one way or the other, you can say: Hey, I know it's X, and people smarter than me have proven that X will behave in a certain way and that I can do certain stuff with it. When building complex systems this can save you a lot of time and nerves. However, with a common, simpler software that most of us build, it's more about writing the eloquent and stylish code, than an absolute necessity for a programmer. You definitely can work in scala for years without knowing anything about it.
- kailuowang 9y agoI wrote introductory blog post answer that. https://tech.iheart.com/why-fp-its-the-composition-f585d17b01d3 https://tech.iheart.com/why-fp-its-the-composition-f585d17b0... TLDR; It's about the ability to compose. Category theory enables more general and powerful composition of components. That is not to say that without CT you won't be able to compose, it's just more cumbersome and less flexible.