9

OOP versus Type Classes in Scala by Alex Nedelcu | Signify Technology

 2 years ago
source link: https://www.signifytechnology.com/blog/2021/03/oop-versus-type-classes-in-scala-by-alex-nedelcu-at-scala-love-in-the-city
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

​We are still reeling from the amazing buzz and talks at Scala Love in the City Conference 2021.

...if you missed it then do not worry! We will be releasing various talks over the coming weeks.

Scala is a hybrid OOP+FP language.

If you love OOP, Scala is one of the best static OOP languages. But Scala also exposes parametric polymorphism and can encode type classes. Thus, developers can also choose to use parametric polymorphism restricted by type classes (aka ad hoc polymorphism). As if choosing when to use immutability versus object identity wasn't bad enough, developers are also faced with a difficult choice when expressing abstractions. Such choices create tension in teams, with the code style depending on the team leader or whoever does the code reviews.

Let's go through what is OOP, what is ad hoc polymorphism via type classes, how to design type classes, go through the pros and cons, and establish guidelines for what to pick, depending on the use case.

Stay posted - lots more to come!!


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK