Level A1: Beginning application programmer
- Java-like statements and expressions: standard operators, method calls, conditionals, loops, try/catch
- class, object, def, val, var, import, package
- Infix notation for method calls
- Simple closures
- Collections with map, filter, etc
- for-expressions
Level A2: Intermediate application programmer
- Pattern matching
- Trait composition
- Recursion, in particular tail recursion
- XML literals
Level A3: Expert application programmer
- Folds, i.e. methods such as foldLeft, foldRight
- Streams and other lazy data structures
- Actors
- Combinator parsers
Level L1: Junior library designer
- Type parameters
- Traits
- Lazy vals
- Control abstraction, currying
- By-name parameters
Level L2: Senior library designer
- Variance annotations
- Existential types (e.g., to interface with Java wildcards)
- Self type annotations and the cake pattern for dependency injection
- Structural types (aka static duck typing)
- Defining map/flatmap/withFilter for new kinds of for-expressions
- Extractors
Level L3: Expert library designer
- Early initializers
- Abstract types
- Implicit definitions
- Higher-kinded types
As I wrote above, the skill sets required from application programmers and library designers are really quite different. But if I should throw them into the same baskets, I would group like this:
A1, A2/L1, A3/L2, L3
网友评论