Scala is a functional and OO language at the same time. Functional languages allows the programmer to perform complex operations in a standardized way regardless the object type. OO languages includes many convenient ideas from object oriented area which can break the functional rules when used. Languages can either one of these two categories, but Scala mixes them together. I will introduce Scala programming from these two parts.
- Functional Part
I mainly introduce some features provided by Scala that make Scala programmer more productive.
- Algebraic data types
- Pattern matching
- Higher order functions and combinators
- Ad hoc polymorphism with type classes using implicits
- Higher kinds of type constructor polymorphism
- Monadic programming
- OO Part
I assume all of you are familiar with object oriented programming. Here, I introduce a specific set of features for developers coming from JAVA which want to become more productive.
- Better type system (Complicated type system)
- Type inference
- Mixin based inheritance using traits
- Better treatment of type variance
- Abstract type members and abstract vals
- Better module system