diff --git a/_overviews/scala3-book/scala-features.md b/_overviews/scala3-book/scala-features.md index 377498f951..1df980d863 100644 --- a/_overviews/scala3-book/scala-features.md +++ b/_overviews/scala3-book/scala-features.md @@ -136,7 +136,7 @@ Because Scala is considered to be a [strong, statically-typed language](https:// - Method type declarations tell readers what the method does, and help serve as documentation - Types make your code easier to maintain - Scalability: types help ensure correctness across arbitrarily large applications and development teams -- Strong types enable Scala features like implicits (TODO: I need help on this wording and description) +- Strong typing in combination with excellent inference enables mechanisms like [contextual abstraction]({{ site.scala3ref }}/contextual/motivation.html) that allows you to omit boilerplate code. Often, this boilerplate code can be inferred by the compiler, based on type definitions and a given context (e.g. method arguments for implicit parameters). {% comment %} In that list: @@ -202,21 +202,23 @@ Scala is a functional programming (FP) language, meaning: - Lambdas are built in - Everything in Scala is an expression that returns a value - Syntactically it’s easy to use immutable variables, and their use is encouraged -- It has a wealth of immutable collections classes in the standard library -- Those collections classes come with dozens of functional methods: they don’t mutate the collection, but instead return an updated copy of the data +- It has a wealth of immutable collection classes in the standard library +- Those collection classes come with dozens of functional methods: they don’t mutate the collection, but instead return an updated copy of the data ### A pure OOP language Scala is a _pure_ object-oriented programming (OOP) language. -Every variable is an object, and every “operator” is a method. +Every variable is an object and every “operator” is a method. In Scala, all types inherit from a top-level class `Any`, whose immediate children are `AnyVal` (_value types_, such as `Int` and `Boolean`) and `AnyRef` (_reference types_, as in Java). This means that the Java distinction between primitive types and boxed types (e.g. `int` vs. `Integer`) isn’t present in Scala. Boxing and unboxing is completely transparent to the user. {% comment %} -Add the “types hierarchy” image here? +- AnyRef above is wrong in case of strict null checking, no? On the other hand, maybe too much information to state this here +- probably not worth to mention (too advanced at this point) there is AnyKind +- Add the “types hierarchy” image here? {% endcomment %} @@ -226,7 +228,7 @@ Add the “types hierarchy” image here? NOTE: This text in the first line comes from this slide: https://twitter.com/alexelcu/status/996408359514525696 {% endcomment %} -The essence of Scala is the fusion of functional programming and object-oriented programming in a typed settings: +The essence of Scala is the fusion of functional programming and object-oriented programming in a typed setting: - Functions for the logic - Objects for the modularity @@ -330,7 +332,7 @@ At a “sea level” view of the details---i.e., the language features programme - Export clauses provide a simple and general way to express aggregation, which can replace the previous facade pattern of package objects inheriting from classes - The procedure syntax has been dropped, and the varargs syntax has been changed, both to make the language more consistent - The `@infix` annotation makes it obvious how you want a method to be applied - - The `@alpha` method annotation defines an alternate name for the method, improving Java interoperability, and letting you provide aliases for symbolic operators + - The [`@targetName`]({{ site.scala3ref }}/other-new-features/targetName.html) method annotation defines an alternate name for the method, improving Java interoperability, and letting you provide aliases for symbolic operators It would take too much space to demonstrate all of those features here, but follow the links in the items above to see those features in action. All of these features are discussed in detail in the *New*, *Changed*, and *Dropped* features pages in the [Overview documentation][reference]. @@ -500,4 +502,3 @@ As this page shows, Scala has many terrific programming language features at a h -