Scala 学习笔记(1)之入门篇

Scala is pronounced skah-lah.

Scala 全称为 scalable language,是一种面向对象(object)函数式(functional静态类型(statically typed)编程脚本(script)语言。

1. 全面支持函数式编程(Functional Programming Paradigm)。如果之前用过LISP或者Scheme应该对这些特性比较熟悉。

  • currying
  • pattern matching
  • algebraic data types
  • lazy evaluation
  • tail recursion
  • immutability

2. 面向对象和函数式编程的混合

  • functional programming constructs make it easy to build interesting things quickly from simple parts
  • object-oriented constructs make it easy to structure larger systems and to adapt them to new demands

3. 脚本语言

很多时候编程语言的入门都是从 HelloWorld 程序开始的。

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

 

如果是Java Programmer,可能更习惯下面的代码:

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

 

执行Scala代码有两种方式,一种是直接解释执行,另一种是先编译再执行。

 

 

 

有用的链接:

WIKI : http://en.wikipedia.org/wiki/Scala_(programming_language)

官网 :http://www.scala-lang.org/

github: https://github.com/scala

Coursera: https://class.coursera.org/progfun-002/class

 书籍链接:

Programming in Scala

 

 

posted @ 2013-08-11 20:12  独木  阅读(337)  评论(0编辑  收藏  举报