You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Studies have shown that the time a developer spends _reading_ code to _writing_ code is at least a 10:1 ratio, so writing code that is concise _and_ readable is important.
113
166
@@ -117,15 +170,33 @@ Studies have shown that the time a developer spends _reading_ code to _writing_
117
170
Scala is a statically-typed language, but thanks to its type inference capabilities it feels dynamic.
118
171
All of these expressions look like a dynamically-typed language like Python or Ruby, but they’re all Scala:
As Heather Miller states, Scala is considered to be a [strong, statically-typed language](https://heather.miller.am/blog/types-in-scala.html), and you get all the benefits of static types:
131
202
@@ -266,20 +337,28 @@ In regards to the second point, large libraries like [Akka](https://akka.io) and
266
337
In regards to the first point, Java classes and libraries are used in Scala applications every day.
267
338
For instance, in Scala you can read files with a Java `BufferedReader` and `FileReader`:
268
339
340
+
{% tabs scala-features-7 %}
341
+
{% tab 'Scala 2 and 3' for=scala-features-7 %}
269
342
```scala
270
343
importjava.io.*
271
344
valbr=BufferedReader(FileReader(filename))
272
345
// read the file with `br` ...
273
346
```
347
+
{% endtab %}
348
+
{% endtabs %}
274
349
275
350
Using Java code in Scala is generally seamless.
276
351
277
352
Java collections can also be used in Scala, and if you want to use Scala’s rich collection class methods with them, you can convert them with just a few lines of code:
@@ -303,7 +382,7 @@ Assuming you told someone about the previous high-level features and then they s
303
382
304
383
## Lower-level language features
305
384
306
-
Where the previous section covered high-level features of Scala 3, it’s interesting to note that at a high level you can make the same statements about both Scala 2 and Scala 3.
385
+
Where the previous section covered high-level features of Scala, it’s interesting to note that at a high level you can make the same statements about both Scala 2 and Scala 3.
307
386
A decade ago Scala started with a strong foundation of desirable features, and as you’ll see in this section, those benefits have been improved with Scala 3.
308
387
309
388
At a “sea level” view of the details---i.e., the language features programmers use everyday---Scala 3 has significant advantages over Scala 2:
0 commit comments