05 March 2013
Cover

Beginning Scala

Written by Lift Scala web framework founder and lead

By Nilanjan Raychaudhuri

Publisher: Manning

Softbound print: March 2013 (est.)

Pages: 525

Even within a single application, programming problems often lend themselves to a particular style of programming — functional, imperative, dynamic — but most programming languages require you to choose a single approach before you start. Scala provides a more flexible option. Scala is a statically typed programming language that blends the object oriented and functional programming models, giving you the flexibility to use the right approach for each specific case. And it's really good! Scala's type system is one of the best out there, and its type inference allows you to write succinct type safe code, crucial for large enterprise teams. Because Scala runs on the JVM, it's immediately practical for any Java shop to start using Scala.

Scala in Action is a comprehensive tutorial that introduces Scala through clear explanations and numerous hands-on examples. Because Scala is a rich and deep language, it can be daunting to absorb all the new concepts at once. This book takes a "how-to" approach, explaining language concepts as you explore familiar programming challenges that you face in your day-to-day work.

You won't just get the theory of functional programming. Instead, you'll learn to do concurrent programming using Scala's Actors and Akka libraries. You won't just discuss integration strategies, you'll learn to effectively mix Scala and Spring. You won't just talk about ways to simplify programming, you'll learn to build DSLs and other productivity tools.

Part 1 Scala: the basics
  1. Why Scala?
  2. Getting Started
  3. OOP in Scala
  4. Having fun with functional data structures
  5. Functional programming
Part 2 Working with Scala
  1. Building web application in functional style
  2. Connecting to a database
  3. Building scalable and extensible components
  4. Making concurrent programming easy with actors
  5. Building confidence with testing
Part 3 Advanced Steps
  1. Interoperability between Scala and Java
  2. Scalable and distributed applications using Akka

Scala 的学习曲线很陡,不过,学会之后,用起来应该很爽!

期待了三年的《Scala in Action》,三月会发布吗?


范例

object HelloWorld {
   def main(args: Array[String]) {
     println("Hello, world!")
   }
 }

或者

object HelloWorld extends App {
   println("Hello, world!")
 }

附:

Mac Shell javac 中文乱码

在 MAC OS X 控制台下使用 javac 命令编译 Java 程序时,会出现乱码的情况,现提供一种解决办法:

打开终端( Terminal)窗口,点击桌面左上方的终端(Terminal) –> 偏好设置(Preferences) –> 设置 –> 高级 –> 字符编码 –> 简体中文(GB23112)。



blog comments powered by Disqus