Effective Programming in Scala

所在平台: Coursera

课程主页: https://www.coursera.org/learn/effective-scala

课程评论:没有评论

第一个写评论        关注课程

课程简介

课程名称:高效的Scala编程 课程概述:Scala是一种富有表现力、多功能且安全的编程语言。在本课程中,您将学习如何充分利用Scala来解决常见的编程任务,例如建模业务域、将复杂问题分解为更简单的问题、数据处理和并行任务执行。 在学习过程中,您还将掌握编写高质量可扩展代码的最佳实践,如何处理错误、撰写测试以及高效的开发环境的应用。本课程是一门全面、实践导向的课程,旨在通过结合函数式编程和面向对象编程来提升您的编程技能。您将熟悉标准库及实际应用中的常见代码模式。 每周有约1小时30分钟的视频讲座,每节讲座约为10分钟,专注于特定技能或概念。我们通常从具体问题开始,然后解释语言特性或库如何提高您解决这些问题的生产力。讲座后通常会有小测验来评估您的进展。在每周的末尾,您将完成一个基于现实世界应用的评分作业,以便实践所学内容。 课程内容涵盖了Scala 3,并提及了与Scala 2的区别。 课程大纲: 1. 入门与基础知识、领域建模:学习如何在计算机上运行Scala,撰写和评估基本表达式与定义,并通过定义案例类和密封特征来建模业务域。 2. 标准库与循环:使用标准库中的通用List数据类型操作值集合,了解其他通用数据结构(集合、序列和映射)及其使用场景,学习实现循环的几种技术及其权衡。 3. 构建工具与模块:学习如何编写比工作表更大的Scala项目,定义Scala项目的入口点,利用工具进行代码的编写、编译、运行和调试,使用面向对象编程技术将复杂项目分解为小的模块组件。 4. 代码推理:推荐默认使用不可变数据类型,探讨在某些情况下可变变量简化代码的情形,深入了解不同的测试技术(单元测试、属性测试、集成测试和模拟)。 5. 类型导向编程:探索Scala的独特特性,编译器能够自动为某些参数生成值,根据参数的预期类型提供明确候选值。 6. 错误处理与并发编程:讨论Scala的异常处理机制及其利弊,展示如何显式在方法签名中处理错误,探讨输入数据验证和异步计算的工作方式,以及如何通过并行运行任务来利用计算机的多核CPU。 通过这个课程,您将掌握使用Scala的能力,提升解决实际问题的技能。

课程大纲

Name:Getting Started, Basics, Domain Modeling

Description:First, get up and running with Scala on your computer. Then, learn how to write and evaluate basic expressions and definitions. Last, learn how to model a business domain by defining case classes and sealed traits.

Name:Standard Library, Loops

Description:Manipulate collections of values by using the generic List data type from the standard library. Then, learn about the other generic data structures provided by the standard library (sets, sequences, and maps), and their respective use cases. All the collection classes have a comprehensive set of high-level operations to transform, filter, and iterate over their elements. Last, you will learn a couple of techniques to implement loops in Scala, and their tradeoffs.

Name:Build Tools, Modules

Description:How to write Scala projects larger than a worksheet? Learn how to define an entry point for a Scala project, and discover the tools you can leverage to write, compile, run, and debug your code. Then, use object-oriented programming techniques to break down a complex project into small modular components. Finally, we discuss when to use case classes versus simple classes.

Name:Reasoning About Code

Description:The recommendation in Scala is to use immutable data types by default. Indeed, they have desirable properties such as being thread-safe and allowing local reasoning. However, in some cases, mutable variables lead to simpler code, as you will see in the lectures. We then dive into different testing techniques such as unit testing, property-based testing, integration testing, and mocking.

Name:Type-Directed Programming

Description:Programs automate repetitive tasks. Sometimes, writing a program is a repetitive task. We look into a unique feature of Scala that lets the compiler write some (repetitive) parts of your programs for you! Based on the expected type of a parameter, the compiler can provide a value for this parameter if it finds an unambiguous candidate value. This technique is often used to automatically generate the serializer and deserializer of a data type, solely based on its definition, for instance.

Name:Error Handling, Concurrent Programming

Description:Scala supports a simple low-level mechanism for error handling: exceptions. We discuss the pros and cons of this mechanism, and we show alternative approaches that you can apply when you want to make it explicit in a method signature that it can fail with an error. We then move to a similar topic, input data validation, where we want to construct nice-looking error messages listing all the errors that the user needs to fix. We conclude with a couple of lectures showing how to work with asynchronous computations, and how to leverage the multiple CPUs of a computer by running tasks in parallel. You will see that the same idioms we used for writing data validation rules can also be used to write graphs of parallel computations.

课程评论(0条)

课程详情

Scala is an expressive, versatile, and safe programming language. In this course, you will learn how to get the most out of Scala to solve common programming tasks such as modeling business domains, breaking down complex problems into simpler problems, manipulating data, or running parallel tasks. Along the journey, you will also learn the best practices for writing high-quality code that scales to large applications, how to handle errors, how to write tests, and how to leverage a productive development environment. This comprehensive, hands-on, course aims at leveling up your programming skills by embracing both functional programming and object-oriented programming. You will become familiar with the standard library and the common patterns of code used in the real world. Each week contains about 1h30 of video lectures. Each lecture is a ~10 min video focused on a specific skill or concept. We always start by looking at concrete problems, and then explain how language features or libraries make you more productive to solve these problems in general. Lectures are generally followed by a quiz to assess your progress. At the end of each week, a graded assignment inspired by real-world applications will give you an opportunity to put things in practice. The course covers Scala 3, and it mentions the differences with Scala 2.

课程标签

0人关注该课程

主题相关的课程