ºÝºÝߣ

ºÝºÝߣShare a Scribd company logo
?
?
1. .
.
Top paying tech in US
2.Java
.
3. . We want to be geek.
4. -
remote .
Scala Job Trends
5.
.
// - .
val a : String = "world"
val b = "hello"
//
val str = "hello world"
val WithHello = "hello (.*)".r
str match {
case WithHello(next) => println(next)
}
.
6.
¡¤ .
¡¤ scala open source contribute .
¡¤
7.threadpoolhell
Scala async .
// Asynchronous computations that yield futures are created with the Future call
val s = "Hello"
val f: Future[String] = Future {
s + " future!"
}
f onSuccess {
case msg => println(msg)
}
8. .
.
9.Richcollectionapi
10. - Try[T]
import scala.util.{Failure, Success, Try}
val success1: Try[String] = Success("success-1")
val success2: Try[String] = Success("success-2")
val fail: Try[String] = Failure(new IllegalStateException("Error"))
val result1 = for {
a <- success1
b <- fail
c <- success2
} yield c
// result1: scala.util.Try[String] = Failure(java.lang.IllegalStateException: Some Error)
val result2 = for {
a <- fail
b <- success1
c <- success2
} yield c
// result2: scala.util.Try[String] = Failure(java.lang.IllegalStateException: Some Error)

More Related Content

Why scala?

  • 1. ? ?
  • 2. 1. . . Top paying tech in US
  • 4. 3. . We want to be geek.
  • 7. 5. . // - . val a : String = "world" val b = "hello" // val str = "hello world" val WithHello = "hello (.*)".r str match { case WithHello(next) => println(next) } .
  • 8. 6. ¡¤ . ¡¤ scala open source contribute . ¡¤
  • 9. 7.threadpoolhell Scala async . // Asynchronous computations that yield futures are created with the Future call val s = "Hello" val f: Future[String] = Future { s + " future!" } f onSuccess { case msg => println(msg) }
  • 12. 10. - Try[T] import scala.util.{Failure, Success, Try} val success1: Try[String] = Success("success-1") val success2: Try[String] = Success("success-2") val fail: Try[String] = Failure(new IllegalStateException("Error")) val result1 = for { a <- success1 b <- fail c <- success2 } yield c // result1: scala.util.Try[String] = Failure(java.lang.IllegalStateException: Some Error) val result2 = for { a <- fail b <- success1 c <- success2 } yield c // result2: scala.util.Try[String] = Failure(java.lang.IllegalStateException: Some Error)