Udemy
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
Scala Programming - From Basics to Advanced
Rating: 4.0 out of 5(11 ratings)
1,036 students

Scala Programming - From Basics to Advanced

Master Scala Programming from basics to advanced, and tackle real-world projects with confidence!
Last updated 8/2024
English

What you'll learn

  • Introduction to Scala: Gain a thorough understanding of Scala's features and capabilities.
  • Variable and Data Types: Learn about variables, arrays, lists, tuples, and sets in Scala.
  • Control Structures: Master loops, conditions, and control structures for effective programming.
  • Classes and Objects: Understand classes, methods, and singleton objects for structured code.
  • Operators and Literals: Explore arithmetic, bitwise operations, and character literals in Scala.
  • Exception Handling: Learn to manage errors and exceptions using try-catch blocks.
  • Functional Programming: Dive into first-class functions, higher-order functions, and reducing code duplication.
  • Inheritance and Extending Classes: Grasp concepts of inheritance, superclass constructors, and class hierarchies.
  • Project-Based Learning: Apply your knowledge in a real-world project, such as employee data analysis.
  • Advanced Features: Work with by-name parameters, factory objects, and implementing primitives for complex applications.

Course content

2 sections72 lectures10h 7m total length
  • Introduction9:35

    Explore Scala, scalable language that blends object oriented and functional programming on the Java platform. See how traits, function values as objects, and Java interoperability enable building scripts to systems.

  • Quiz on Scala Intro
  • Variable9:56

    Discover the basics of Scala variables, using val and var with type inference, print hello world, and grasp reassignment rules and multi-line input via the Scala interpreter.

  • Writing Scripts11:30

    Learn to write Scala functions with def, parameter and result types, use if expressions, explore unit, and run scripts with println, args, and comments, including simple string concatenation.

  • Loops and conditions10:42

    Explore while loops and if conditions in Scala, demonstrate printing and incrementing, discuss type inference and braces, and compare imperative and functional styles with for expressions.

  • Quiz on variables, Scripts and loops
  • Parameterizing Arrays with Types Part 16:08

    Learn to parameterize Scala arrays with types and values, using type parameters in square brackets and value parameters in parentheses, with practical array initialization.

  • Parameterizing Arrays with Types Part 26:22
  • Lists7:40

    Learn how Scala lists enable functional programming with immutable lists built from cons and nil, support for prepending elements efficiently, and strategies to append via reverse or a list buffer.

  • Tuples9:53

    Learn how Scala tuples are immutable containers that hold mixed types, access elements with underscore indices, and return multiple values compared to lists.

  • sets11:32
  • Vars vs. Vals10:27

    Explore how Scala balances immutable values (vals) with mutable vars, refactoring imperative code into a functional style, minimizing side effects and embracing unit results for testable programs.

  • Writing Scripts to create Set in Tuples15:50

    Explore writing a scala script that reads lines from a file and prints each line with its length, using a functional style and optional formatting to align the output.

  • Classes, field and Methods10:25

    Explore Scala programming concepts like classes and objects, including fields, methods, and private state, using a checksum accumulator example to show instantiation, mutability, and access control in a Scala application.

  • Classes and Semicolon Inference8:52

    Explore how Scala handles class design with a checksum accumulator, define side-effect methods, and use semicolon inference to write concise, unit-typed procedures.

  • Singleton Objects8:56

    Explore singleton objects in Scala by contrasting them with classes, and learn how a companion object shares private members with its class, exposes a calculate method, and uses a cache.

  • Writng Apps in scala11:22
  • Basic Types11:18

    Explore scala's basic types, including byte, short, int, long, char, and boolean, alongside strings, floats, and doubles, and learn their Java-like ranges, literals, and operator behavior.

  • Character Literals8:39

    Discover how Scala represents literals, from floating point, floats and doubles, to character literals with octal, hex, and unicode escapes, plus raw strings and stripMargin for multiline text.

  • Operators and Symbol Literals11:33

    Explore symbol literals in Scala, including their interned nature and how to pass names, and learn that operators are just methods with infix, prefix, and postfix notation.

  • Arithmetic Operators10:50
  • Bitwise Operations Part 16:26
  • Bitwise Operations Part 25:58

    Scala explains reference equality with EQ and NE, and details operator precedence and associativity, including assignment operators and how the first and last characters of operator names affect evaluation.

  • Rational Objects10:54

    Explore designing immutable functional objects in Scala by building a rational class with numerator and denominator, supporting addition, subtraction, multiplication, and division, using primary constructor.

  • Preconditions Part 16:15
  • Preconditions Part 26:06
  • Auxiliary Constructors8:27

    Explore auxiliary constructors in Scala by modeling rationals with a single-argument constructor that defaults the denominator to one, invoking the primary constructor.

  • Private Fields and Methods11:01
  • Defining Operators Part 16:11
  • Defining Operators Part 26:15

    Explore Scala's identifier rules, including alphanumeric, operator forms, and constants, and how camel case, underscores, and the dollar prefix affect variables, methods, and classes, plus how the compiler mangles operators.

  • Method Overloading Part 17:50

    Explore method overloading in Scala to support mixed arithmetic on rational numbers and integers, with overloaded plus, minus, times, and divide methods and compiler driven resolution.

  • Method Overloading Part 26:10

    Explore method overloading in Scala by building a rational class with plus, minus, multiply, divide, and gcd-based normalization, plus custom constructors and implicit conversions.

  • If Expression and While,Do-While Loops Part 16:25

    Explore Scala's built-in control structures—if, while, for, try, match, and function calls—and how they produce values, with libraries providing most controls and immutable vals.

  • If Expression and While,Do-While Loops Part 26:40

    Explore Scala while and do-while loops, understand unit values, and compare imperative and functional styles while looping until conditions meet, with gcd and input examples.

  • For Expressions Part 16:59
  • For Expressions Part 26:44
  • Exception Handling with Try Expressions Part 16:09

    Explore Scala exception handling with try expressions, throwing and catching exceptions, understanding throw as an expression, and using catch clauses with pattern matching to handle errors.

  • Exception Handling with Try Expressions Part 26:29
  • Match Expressions Part 16:55
  • Match Expressions Part 26:26

    Translate Java loop patterns to Scala by rewriting the while loop with an if guard or a recursive function, using argument length checks and starts with and ends with checks.

  • Variable Scope Part 16:00
  • Variable Scope Part 26:48
  • Methods11:13
  • First Class Functions & Part 17:38

    Explore first-class functions in Scala, writing function literals and values, and invoking them with apply. Learn short-form literals, target typing, and using for each and filter on collections.

  • First Class Functions & Part 26:20
  • First Class Functions Part 2 & Part 16:38

    Discover how Scala creates function values from sums with underscores, preview the compiler-generated apply method, and master partially applied functions and for each usage.

  • First Class Functions Part 2 & Part 26:22

    Explore how Scala implements first-class functions by capturing free variables in closures, producing runtime function values that reflect external changes and maintain per-closure bindings.

  • Repeated parameters & Part 16:51

    Explore Scala repeated parameters and varargs using a star for the last parameter and colon underscore star to pass array elements to echo. Tail recursion runs without overhead.

  • Repeated parameters & Part 27:26

    Explore tail recursion in Scala, learn how tail calls optimize stack usage, and understand limitations with indirect recursion, function values, and repeated parameters.

  • Reducing code duplication & Part 17:32

    Explore reducing code duplication through higher-order functions and function values, learning currying and binding parameters to build control abstractions for flexible file search API.

  • Reducing code duplication & Part 27:04
  • Higher Order Functions10:42
  • New Control Structures9:22
  • By-name Parameters7:32

    Explain by-name and binding parameters in Scala, illustrate with my assert vs boolean assert, and show how by-name parameters enable concise, side-effect-free control patterns using higher-order functions.

  • Two Dimensional Layouts Part 16:41

    Examine a two dimensional layout library using composition and inheritance to build rectangular text elements with abstract classes, combinators like above and beside, and factory methods.

  • Two Dimensional Layouts Part 26:47

    Explore parameter list methods in Scala, distinguish parameterless from empty-parameter forms, and apply the uniform access principle. Define height and width in an abstract element using contents length.

  • Extending Classes11:50

    Extend Scala classes by creating a subclass that implements the abstract contents method, inherits from element, and explores composition and the uniform access principle with val or var fields.

  • Invoking Superclass Constructors Part 17:13
  • Invoking Superclass Constructors Part 26:01

    Explore how Scala handles inheritance and dynamic binding by overriding a demo method in array and line element classes while uniform element inherits the superclass implementation, showing runtime method resolution.

  • Declaring members of Inheritence12:00

    Discover how to declare final members and final classes in Scala inheritance to prevent overrides, fragile base class issues. Compare inheritance with composition and explore above, beside, and mkString formatting.

  • Defining Factory Object12:01

    Explore how to define a factory object in Scala to centralize object creation for layout elements, using a companion object with overloaded LM methods to hide implementation details.

  • Class Hierarchy7:28

    Explore scala's class hierarchy from any to nothing, including null, with anyval and anyref, and learn how value classes derive from them and use implicit widening.

  • Implementation of Primitives9:44

    Discover how Scala implements primitives, stores 32-bit integers, and uses autoboxing for Java interop, and how equality handles value versus reference semantics and bottom types like Null and Nothing.

Requirements

  • Basic Programming Knowledge: Familiarity with fundamental programming concepts such as variables, loops, and functions.
  • Object-Oriented Programming (OOP) Concepts: Understanding of classes, objects, inheritance, and polymorphism.
  • Basic Command Line and IDE Skills: Proficiency in navigating command line interfaces and using integrated development environments (IDEs) for coding.
  • Understanding of Functional Programming (Optional): While not mandatory, prior exposure to functional programming concepts can be beneficial.
  • Java Knowledge (Optional): Some familiarity with Java programming language basics can aid in understanding Scala, as Scala runs on the JVM (Java Virtual Machine).

Description

Course Introduction

Welcome to "Scala Programming - From Basics to Advanced," a comprehensive course designed to take you from a beginner to a proficient Scala developer. Scala, known for its concise syntax and functional programming features, is a powerful language that runs on the Java Virtual Machine (JVM). This course is tailored to provide a deep understanding of Scala, making it an excellent choice for both new and experienced programmers looking to expand their skills.

Section 1: Scala Programming

In this section, students will gain a thorough grounding in Scala programming. We begin with an introduction to the language, where students will learn about Scala's syntax, variables, and the basics of writing scripts. As we progress, we'll delve into loops, conditions, and parameterizing arrays with types, providing a solid foundation in control structures and data manipulation.

We'll cover essential topics such as lists, tuples, sets, and the differences between mutable (vars) and immutable (vals) data structures. Students will also learn how to create sets in tuples through scripting. The section continues with an in-depth look at classes, fields, methods, and semicolon inference, as well as singleton objects and app development in Scala.

Advanced topics include basic types, character literals, operators, arithmetic, and bitwise operations. We'll explore rational objects, preconditions, auxiliary constructors, private fields, methods, operator definitions, and method overloading. Control structures like if expressions, while and do-while loops, for expressions, and exception handling with try expressions will be thoroughly covered. The section concludes with match expressions, variable scope, first-class functions, repeated parameters, reducing code duplication, higher-order functions, new control structures, and by-name parameters.

Section 2: Project On Scala: Employee Data Analysis

This project-based section is designed to apply the skills learned in Section 1 through a real-world scenario: Employee Data Analysis. Starting with an introduction to the project, students will set up their development environment, create project structures, and configure necessary dependencies.

The project will involve reading and manipulating CSV data using Scala, leveraging JDBC API for data insertion and fetching, and working with files from the classpath. Students will gain hands-on experience in configuring POM, understanding data structures, and executing Scala-based data analysis tasks.

Course Conclusion

By the end of this course, students will have developed a robust understanding of Scala programming, from basic concepts to advanced techniques. They will be well-equipped to handle real-world programming challenges, particularly in data analysis and application development. This course will empower students to harness the full potential of Scala, making them proficient in one of the most versatile programming languages in the industry.

Who this course is for:

  • Programming Enthusiasts: Individuals keen on expanding their programming skills beyond basic languages.
  • Software Developers: Professionals looking to learn a powerful language for backend development and scalable applications.
  • Computer Science Students: Students pursuing degrees or certifications in computer science or related fields.
  • Java Developers: Those interested in leveraging Scala's interoperability with Java for improved productivity.
  • Tech Entrepreneurs: Individuals aiming to build robust and scalable applications using modern programming paradigms.
  • Anyone Interested in Functional Programming: Individuals curious about functional programming principles and their application in real-world scenarios.
  • Career Changers: Individuals transitioning into software development careers and seeking in-demand skills.
  • Freelancers and Consultants: Self-employed professionals wanting to offer Scala development services.
  • Technology Managers: Managers looking to understand Scala to better lead development teams and projects.
  • Open Source Contributors: Developers interested in contributing to Scala libraries and frameworks.