zoukankan      html  css  js  c++  java
  • 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

  • 相关阅读:
    Linux
    Other
    Linux
    VIM
    Linux
    其他
    Win10
    Win10
    IDE
    其他
  • 原文地址:https://www.cnblogs.com/huys03/p/3251841.html
Copyright © 2011-2022 走看看