- 浏览: 182487 次
- 性别:
- 来自: 武汉
文章分类
- 全部博客 (100)
- git (1)
- j2ee (7)
- python (9)
- mysql (1)
- php (9)
- android (6)
- 翻译 (0)
- web 前端 (3)
- ruby (0)
- java (8)
- 读书 (1)
- object-c 之 iphone (9)
- scala (19)
- iphone (13)
- c/c++ (3)
- apache (2)
- javascript (5)
- vi (1)
- lift (5)
- jquery (1)
- dos (1)
- java解惑 (1)
- excel函数 (1)
- 软件开发 (2)
- wxwidget (2)
- mac (1)
- virtualbox (1)
- discuz (2)
- struts2 (2)
- jsp (1)
- object-c (5)
- http (1)
- codeigniter (1)
- django (1)
- regx (1)
最新评论
-
a564941464:
一样
Initializers -- object-c中的alloc init的解释 -
pj7670623:
幸好有~~~有道!!不然咋看的懂哦!
Initializers -- object-c中的alloc init的解释 -
higherzjm:
[flash=200,200][/flash][url][/u ...
用jdb调试Java程序
Scala is a bit of a chameleon. It makes many programming tasks refreshingly easy and at the same time contains some pretty intricate constructs that allow experts to design truly advanced typesafe libraries. This means that, depending at what piece of code you look at, Scala might look very simple or very complex. But which pieces exactly are easy for beginners and which are more advanced? In the end, everybody will have their own yardstick. Nevertheless, I am trying here to give a rough categorization.
I hope this will help newcomers to the language decide in what order to pick subjects to learn, and that it will give some advice to teachers and book authors in what order to present the material.
I assume that programmers have already a good knowledge of Java, so we can take at least pre-generics Java 1.4 for granted. If that's not the case, some of the entry-level concepts such as classes and exceptions would need to be moved to more advanced levels.
Also, I distinguish between Scala application programmers and Scala library designers, because the required skill sets are really quite different. A first shot at a categorization has been discussed last month on the scala-debate mailing list. The current categorization incorporates some of the suggestions that were made then. So, here we go:
Level A1: Beginning application programmer
Java-like statements and expressions: standard operators, method calls, conditionals, loops, try/catch
class, object, def, val, var, import, package
Infix notation for method calls
Simple closures
Collections with map, filter, etc
for-expressions
Level A2: Intermediate application programmer
Pattern matching
Trait composition
Recursion, in particular tail recursion
XML literals
Level A3: Expert application programmer
Folds, i.e. methods such as foldLeft, foldRight
Streams and other lazy data structures
Actors
Combinator parsers
Level L1: Junior library designer
Type parameters
Traits
Lazy vals
Control abstraction, currying
By-name parameters
Level L2: Senior library designer
Variance annotations
Existential types (e.g., to interface with Java wildcards)
Self type annotations and the cake pattern for dependency injection
Structural types (aka static duck typing)
Defining map/flatmap/withFilter for new kinds of for-expressions
Extractors
Level L3: Expert library designer
Early initializers
Abstract types
Implicit definitions
Higher-kinded types
As I wrote above, the skill sets required from application programmers and library designers are really quite different. But if I should throw them into the same baskets, I would group like this:
A1, A2/L1, A3/L2, L3
That is, intermediate application programming is about on the same level of difficulty as junior library design, and advanced application programming is on the same level as senior library design.
To clarify: One can program very productively in Scala on level A1, which one should be able to pick up in a day or so, coming from Java. Mastering A2 will doubtlessly increase programmer productivity. A3 is for expert programmers with more specialized tasks, not everyone needs to get to that level. The same holds for library design. There are great libraries designed with the tools on level L1 and L2. Some libraries require L3 elements such as implicits and higher-kinded types, but a library does not automatically get better if it uses these elements -- often the opposite is true.
I hope this will help newcomers to the language decide in what order to pick subjects to learn, and that it will give some advice to teachers and book authors in what order to present the material.
I assume that programmers have already a good knowledge of Java, so we can take at least pre-generics Java 1.4 for granted. If that's not the case, some of the entry-level concepts such as classes and exceptions would need to be moved to more advanced levels.
Also, I distinguish between Scala application programmers and Scala library designers, because the required skill sets are really quite different. A first shot at a categorization has been discussed last month on the scala-debate mailing list. The current categorization incorporates some of the suggestions that were made then. So, here we go:
Level A1: Beginning application programmer
Java-like statements and expressions: standard operators, method calls, conditionals, loops, try/catch
class, object, def, val, var, import, package
Infix notation for method calls
Simple closures
Collections with map, filter, etc
for-expressions
Level A2: Intermediate application programmer
Pattern matching
Trait composition
Recursion, in particular tail recursion
XML literals
Level A3: Expert application programmer
Folds, i.e. methods such as foldLeft, foldRight
Streams and other lazy data structures
Actors
Combinator parsers
Level L1: Junior library designer
Type parameters
Traits
Lazy vals
Control abstraction, currying
By-name parameters
Level L2: Senior library designer
Variance annotations
Existential types (e.g., to interface with Java wildcards)
Self type annotations and the cake pattern for dependency injection
Structural types (aka static duck typing)
Defining map/flatmap/withFilter for new kinds of for-expressions
Extractors
Level L3: Expert library designer
Early initializers
Abstract types
Implicit definitions
Higher-kinded types
As I wrote above, the skill sets required from application programmers and library designers are really quite different. But if I should throw them into the same baskets, I would group like this:
A1, A2/L1, A3/L2, L3
That is, intermediate application programming is about on the same level of difficulty as junior library design, and advanced application programming is on the same level as senior library design.
To clarify: One can program very productively in Scala on level A1, which one should be able to pick up in a day or so, coming from Java. Mastering A2 will doubtlessly increase programmer productivity. A3 is for expert programmers with more specialized tasks, not everyone needs to get to that level. The same holds for library design. There are great libraries designed with the tools on level L1 and L2. Some libraries require L3 elements such as implicits and higher-kinded types, but a library does not automatically get better if it uses these elements -- often the opposite is true.
发表评论
-
Nil
2011-09-28 11:41 786关于scala中的Nil: 关于函数当参数: -
In Scala, every defined variable has to be initialized at the point of its definit
2011-09-28 11:31 808In Scala, every defined variable ... -
scala中的case class
2011-09-27 21:43 811scala中的case class中的字段不需要显式声明即可直 ... -
scala中的基本类型的表示
2011-09-27 20:24 0引用Byte 8-bit signed 2's comple ... -
scala中将doule转换为int
2011-09-27 17:28 879(100.12).toInt (100.12).asInst ... -
scala中的协变,逆变
2011-08-14 02:45 1025trait Queue[+T] { ... } Prefixin ... -
scala中的for表达式
2011-08-11 23:58 914通常,scala中for表达式有如下形式: for ( seq ... -
lift中的路径映射
2011-08-03 23:40 1090以下英文引用自:http://simply.liftweb.n ... -
scala match compared to java switch
2011-08-03 11:00 962There are three differences to ... -
scala中xml mode
2011-07-31 23:04 1031class varval(x:String,var y:Str ... -
scala中类的var val参数
2011-07-31 23:03 1311class varval(x:String,var y:Str ... -
scala 中的修饰符 private
2011-07-31 22:30 974Example 5.2.1 The following cod ... -
scala中的预先定义
2011-07-31 22:08 983Early definitions are particular ... -
scala 函数声明使用返回值时要用=号
2011-07-31 20:30 2578class Operators{ def retStri ... -
lift中的snippet中报错not found
2011-07-31 12:17 1277报错代码信息: Snippit with incorrect ... -
scala+lift+maven+eclipse 环境配置
2011-07-25 09:00 2081下面是在网上google时,看到的一篇在eclipse中配置 ... -
scala保留字
2011-07-18 14:58 1189abstract case catch class def ... -
scala中的require说明
2011-07-05 13:30 1123The require method is defined in ... -
scala unit
2011-07-02 20:24 1069A result type of Unit indicates ...
相关推荐
【课程大纲】第1讲-Spark的前世今生第2讲-课程介绍、特色与价值第3讲-Scala编程:基础语法第4讲-Scala编程:条件控制与循环第5讲-Scala编程:函数入门第6讲-Scala编程:函数入门之默认参数和带名参数第7讲-Scala编程...
赠送jar包:scala-parser-combinators_2.11-1.0.4.jar; 赠送原API文档:scala-parser-combinators_2.11-1.0.4-javadoc.jar; 赠送源代码:scala-parser-combinators_2.11-1.0.4-sources.jar; 包含翻译后的API...
【课程大纲】第1讲-Spark的前世今生 共12页第2讲-课程介绍、特色与价值 共13页第3讲-Scala编程详解:基础语法 共8页第4讲-Scala编程详解:条件控制与循环 共7页第5讲-Scala编程详解:函数入门 共5页第6讲-Scala编程...
【课程大纲】第1讲-Spark的前世今生 共12页第2讲-课程介绍、特色与价值 共13页第3讲-Scala编程详解:基础语法 共8页第4讲-Scala编程详解:条件控制与循环 共7页第5讲-Scala编程详解:函数入门 共5页第6讲-Scala编程...
【课程大纲】第1讲-Spark的前世今生 共12页第2讲-课程介绍、特色与价值 共13页第3讲-Scala编程详解:基础语法 共8页第4讲-Scala编程详解:条件控制与循环 共7页第5讲-Scala编程详解:函数入门 共5页第6讲-Scala编程...
【课程大纲】第1讲-Spark的前世今生 共12页第2讲-课程介绍、特色与价值 共13页第3讲-Scala编程详解:基础语法 共8页第4讲-Scala编程详解:条件控制与循环 共7页第5讲-Scala编程详解:函数入门 共5页第6讲-Scala编程...
【课程大纲】第1讲-Spark的前世今生 共12页第2讲-课程介绍、特色与价值 共13页第3讲-Scala编程详解:基础语法 共8页第4讲-Scala编程详解:条件控制与循环 共7页第5讲-Scala编程详解:函数入门 共5页第6讲-Scala编程...
【课程大纲】第1讲-Spark的前世今生 共12页第2讲-课程介绍、特色与价值 共13页第3讲-Scala编程详解:基础语法 共8页第4讲-Scala编程详解:条件控制与循环 共7页第5讲-Scala编程详解:函数入门 共5页第6讲-Scala编程...
【课程大纲】第1讲-Spark的前世今生 共12页第2讲-课程介绍、特色与价值 共13页第3讲-Scala编程详解:基础语法 共8页第4讲-Scala编程详解:条件控制与循环 共7页第5讲-Scala编程详解:函数入门 共5页第6讲-Scala编程...
【课程大纲】第1讲-Spark的前世今生 共12页第2讲-课程介绍、特色与价值 共13页第3讲-Scala编程详解:基础语法 共8页第4讲-Scala编程详解:条件控制与循环 共7页第5讲-Scala编程详解:函数入门 共5页第6讲-Scala编程...
【课程大纲】第1讲-Spark的前世今生 共12页第2讲-课程介绍、特色与价值 共13页第3讲-Scala编程详解:基础语法 共8页第4讲-Scala编程详解:条件控制与循环 共7页第5讲-Scala编程详解:函数入门 共5页第6讲-Scala编程...
【课程大纲】第1讲-Spark的前世今生 共12页第2讲-课程介绍、特色与价值 共13页第3讲-Scala编程详解:基础语法 共8页第4讲-Scala编程详解:条件控制与循环 共7页第5讲-Scala编程详解:函数入门 共5页第6讲-Scala编程...
【课程大纲】第1讲-Spark的前世今生 共12页第2讲-课程介绍、特色与价值 共13页第3讲-Scala编程详解:基础语法 共8页第4讲-Scala编程详解:条件控制与循环 共7页第5讲-Scala编程详解:函数入门 共5页第6讲-Scala编程...
赠送jar包:scala-xml_2.11-1.0.1.jar; 赠送原API文档:scala-xml_2.11-1.0.1-javadoc.jar; 赠送源代码:scala-xml_2.11-1.0.1-sources.jar; 赠送Maven依赖信息文件:scala-xml_2.11-1.0.1.pom; 包含翻译后的API...
赠送jar包:scala-xml_2.11-1.0.4.jar; 赠送原API文档:scala-xml_2.11-1.0.4-javadoc.jar; 赠送源代码:scala-xml_2.11-1.0.4-sources.jar; 赠送Maven依赖信息文件:scala-xml_2.11-1.0.4.pom; 包含翻译后的API...
Scala,作为一种将面向对象编程和函数式编程完美结合的语言,提供了强大的函数式编程特性。Scala的函数式编程(FP)不仅包括高阶函数、匿名函数、递归和模式匹配等,还提供了不可变数据结构和纯函数等核心概念。本文...
赠送jar包:scala-library-2.11.8.jar; 赠送原API文档:scala-library-2.11.8-javadoc.jar; 赠送源代码:scala-library-2.11.8-sources.jar; 赠送Maven依赖信息文件:scala-library-2.11.8.pom; 包含翻译后的API...
使用Scala的Leetcode解决方案 ID 问题 解决方案 测试用例 58 345 Scala99: 将Scala-test和Junit集成到Scala中 编写此应用程序时,我发现它可以在本地Intellij IDEA+Junit运行测试用例,但是如果尝试执行sbt test...