Scala函数式编程原理

Scala函数式编程原理
Scala函数式编程原理

Scala函数式编程原理

Learn about functional programming, and how it can be effectively combined with object-oriented programming. Gain practice in writing clean functional code, using the Scala programming language.

课程概述

This course introduces the cornerstones of functional programming using the Scala programming language. Functional programming has become more and more popular in recent years because it promotes code that’s safe, concise, and elegant. Furthermore, functional programming makes it easier to write parallel code for today’s and tomorrow’s multiprocessors by replacing mutable variables and loops with powerful ways to define and compose functions.

Scala is a language that fuses functional and object-oriented programming in a practical package. It interoperates seamlessly with Java and its tools. Scala is now used in a rapidly increasing number of open source projects and companies. It provides the core infrastructure for sites such as Twitter, LinkedIn, Foursquare, Tumblr, and Klout.

In this course you will discover the elements of the functional programming style and learn how to apply them usefully in your daily programming tasks. You will also develop a solid foundation for reasoning about functional programs, by touching upon proofs of invariants and the tracing of execution symbolically.

The course is hands on; most units introduce short programs that serve as illustrations of important concepts and invite you to play with them, modifying and improving them. The course is complemented by a series of assignments, most of which are also programming projects.

认证证书:用真实身份验证课程作业

?个人认证地址

?课程记录分享

?“添加到领英”功能

?专属技术支持

授课大纲

Week One:Programming paradigms; overview of functional programming and the Scala programming language.

Week Two: Defining and using functions, recursion and non-termination, working with functions as values, reasoning by reduction.

Week Three: Defining and using immutable objects, review of inheritance and dynamic binding. Week Four: Types and Pattern Matching

Week Five: Working with Lists

Week Six: Collections and Combinatorial Search

Week Seven: Lazy Evaluation

先修知识

You should have at least one year programming experience. Proficiency with Java or C# is ideal, but experience with other languages such as C/C++, Python, Javascript or Ruby is also sufficient.

参考资料

The class is designed to be self-contained. For further reading on some of the ideas in the course, we recommend Structure and Interpretation of Computer Programs - 2nd Edition (MIT Electrical Engineering and Computer Science)by Abelson and Sussman, published by MIT Press. For learning more about Scala, we recommend Programming in Scala: A Comprehensive Step-by-Step Guide, 2nd Edition by Odersky, Spoon and Venners, published by Artima Press, or else Scala for the Impatient, by Horstmann, published by Addison Wesley.

授课形式

The class will consist of lecture videos, which are between 6 and 15 minutes in length. These contain integrated quiz questions per video. There will also be standalone homeworks that are not part of video lectures.

常见问题解答

?Will I get a certificate after completing this class?

Yes. Students who successfully complete the class will receive a certificate signed by the instructor.

?What resources will I need for this class?

You should have the following installed: - Java Virtual Machine JDK

1.6 or higher. - A Scala distribution version

2.9 or higher The

recommended development environment for the course is the Scala IDE for Eclipse. It comes with a Scala distribution so if you intend to work only in Eclipse you just need to install the Scala IDE.

?What is the coolest thing I'll learn if I take this class?

Write elegant code that works the first time it is run.

班次

课程特点

认证证书

完成声明

课程信息

7周课程内容

5-7 小时/周

英语

英语字幕

授课教师

Martin Odersky洛桑联邦理工学院

课程类型

计算机科学:软件工程

分享

相关课程

Principles of Reactive Programming

Pattern-Oriented Software Architectures for Concurrent and Networked Software

Programming Languages

Functional Programming Principles in Scala

洛桑联邦理工学院

Scala函式编程原理

Martin Odersky

来学习函式编程和它怎样与面向对象编程有效地结合在一起。使用Scala编程语言来练习写纯粹的函式代码。

关于这门课

这门课使用Scala编程语言来介绍函式编程基础。最近几年,函式编程越来越流行了,因为它能够使得代码更加安全、简明和优雅。更进一步,函式编程通过非常有力的方式来定义和构建函数以替代可变变量和循环,这样使得人们可以很容易地写出能在现在甚至未来的多处理器上运行的并行代码。

Scala是一门将函式和面向对象编程结合在一个实用包里的语言。它与Java及其工具无缝交互。使用Scala的开源项目和公司的数目迅猛增长。它为诸如Twitter、LinkedIn、Foursquare、Tumblr和Klout这样的网站提供了核心基础。

在这门课里你将发现函式编程风格的基本元素,并且学习如何将他们应用到你的日常编程任务里。你还将通过不变量的证明和对符号化执行的跟踪建立起对函式程序推导的坚实基础。

这门课还有实际的练习。绝大多数单元都会介绍一些小程序来展示重要的概念,欢迎你们摆弄、修改和提高他们。这门课还包含有一系列的任务,它们大多数都是编程项目。

课程表

第一周:编程范式:函式编程和Scala语言总览

第二周:定义和使用函数,递归和无终止,将函数当作值来使用,归纳推导

第三周:定义和使用不变对象,复习继承和动态绑定

第四周:类型和模式匹配

第五周:使用链表

第六周:集合和组合搜索

第七周:惰性求值

推荐背景

你应该有至少一年的编程经历。对Java或者C#熟悉则非常理想,但是有使用其他语言诸如C/C++、Python、Javascript或者Ruby的经历也足够了。

推荐阅读

这门课被设计成自包含的。对于一些课程中的思想的延伸阅读,我们推荐由Abelson和Sussman撰写的Structure and Interpretation of Computer Programs - 2nd Edition (MIT Electrical Engineering and Computer Science),这本书由MIT Press出版。如果希望深入学习Scala,我们推荐由Odersky编写的Programming in Scala: A Comprehensive Step-by-Step Guide, 2nd Edition,这本书由Venners赞助,由Artima Press出版。或者另一本Scala for the Impatient,作者是Horstmann,Addison Wesley出版。

课程形式

这门课包含了课程视频,每集大约6至15分钟。视频中集成了随堂测试。此外,还有一些需要独立完成的作业。

常见问题

我会在完成课程之后获得一个证书吗?

是的。那些成功地完成了课程的学生会获得一个由老师签名的证书。

对于这门课我需要些什么资源?

你需要安装以下软件:- Java Virtual Machine JDK 1.6 or higher. - A Scala distribution version 2.9 or higher。这门课推荐的开发环境是Scala IDE for Eclipse。它包含了一个Scala发行版,所以如果你打算只在Eclipse里面工作,你只需要安装这个Scala IDE。

如果我参加了这个课程,我能学到的最酷的事情是什么?

你能够编写第一次运行就能工作的优美代码。

分类:

计算机科学:软件工程

译注:这门课的老师就是Scala语言的发明人。

本文由ctzsm授权(果壳网)发表,文章著作权为原作者所有。

相关主题
相关文档
最新文档