Scala Catalog of functional Design Patterns

前端 未结 1 1780
攒了一身酷
攒了一身酷 2021-02-05 20:37

Since a week I\'m reading Programming in Scala. The authors introduce elements of the language step by step , but I\'m still confused when to use the functional things like acto

1条回答
  •  执笔经年
    2021-02-05 21:07

    Being confused about when to use closures or currying is like being confused about when to use classes. They are just part of the language, and serve any task you put it to. When OO first reached mainstream, pretty much the same question was asked of classes.

    As for actors, they are a distributed programming paradigm -- and not, mind you, part of the language itself. They are used when you want to take advantage of concurrency, and your application does not need to share state between concurrent processes, nor is it mainly oriented towards parallel processing.

    0 讨论(0)
提交回复
热议问题