Scala Fundamentals

Video description

You’re a software developer with a basic understanding of Java, but you want to write concise and expressive code in a purely functional style. This course covers the fundamentals of Scala, a dynamic, general-purpose programming language for the Java Virtual Machine (JVM) used in everything from data science to distributed computing. You’ll dive into such topics as methods, classes, objects, and functions, and master best practices so you can be on your way to writing Scala code that is elegant, scalable, and fully interoperable with Java. Once you’ve added the skills in this course to your programming tool belt, you’ll be ready to move on to more advanced Scala development challenges.

Table of contents

  1. Introduction
    1. What Is Scala?
    2. What Are The Positives Of Scala?
    3. What Are The Negatives Of Scala?
    4. About The Author
  2. Setup
    1. Downloading Scala
    2. Installing Scala - Windows
    3. Installing Scala - Mac
    4. Installing Scala - Linux
    5. Creating A Script In Scala
    6. Creating An Application In Scala
  3. Scala Basics
    1. val And var
    2. Lazy val
    3. Bending Variables And Values To Your Will
    4. byte, short, int, long, Floats, Booleans, And Doubles
    5. if, else if, else
    6. while, do while
    7. For Loops
    8. Strings
    9. Smart Strings
    10. String Formatting
    11. String Interpolation
  4. Scala Methods
    1. Basic Methods
    2. Any, AnyVal, AnyRef
    3. Different Return Types
    4. Unit And Unit Conventions
    5. Recursion
    6. Tail Optimized Recursion
    7. Methods In Methods
    8. Bending Method Names To Your Will
    9. Operator Overloading
    10. Method Overloading
    11. Named And Default Arguments
    12. AsInstanceOf And IsInstanceOf
    13. Parameterized Types On Methods
  5. Scala Classes
    1. Classes
    2. Java Getters And Java Setters
    3. Constructors
    4. Constructor Named And Default Arguments
    5. Methods In Classes
    6. Preconditions, Exceptions, And Exception Handling
    7. Subclassing
    8. Overriding Methods
    9. equals, hashCode, toString
    10. Case Classes
    11. Abstract Classes
    12. Parameterized Types On Classes
    13. Parameterized Methods In Classes
  6. Scala Object
    1. Singleton Objects
    2. Companion Objects
  7. Magical Methods
    1. The Magic Apply Method
    2. Infix Operators
    3. Right-Associative Colons
  8. Scala Option
    1. Scala Option - Part 1
    2. Scala Option - Part 2
  9. Scala Tuples
    1. Scala Tuples - Part 1
    2. Scala Tuples - Part 2
  10. Higher Order Functions
    1. Creating A Function - Part 1
    2. Creating A Function - Part 2
    3. Creating A Function - Part 3
    4. Is It A Method Or Is It A Function?
    5. Converting A Method To A Function - Part 1
    6. Converting A Method To A Function - Part 2
    7. Closures
    8. Functions With Functions
    9. Currying
    10. Curried Method Parameters
    11. By-Name Parameters - Part 1
    12. By-Name Parameters - Part 2
  11. Collection Basics
    1. The Importance Of A Language With A Clean API
    2. Lists
    3. Sets
    4. Maps And Symbols
    5. Arrays And Repeated Parameters
    6. Ranges
  12. Collections With Functions
    1. map
    2. filter, filterNot, And exists
    3. forEach
    4. flatMap
    5. For Comprehensions
    6. fold And reduce
    7. zip
    8. Finding Your Method In The API
    9. Solving Functionally With Scala
  13. Conclusion
    1. Wrap Up
  14. Introduction
    1. Welcome To The Course
    2. About The Author
  15. Using Val And Var
    1. Overview Of Val And Var
    2. Common Usages Of Val
    3. Common Usages Of Var
    4. Using Var Vs. Mutable Datatypes
    5. Using Var In Loop Contexts
  16. Functions As Objects
    1. Storing Defs Inside Of Vars
    2. Storing Functions In Lists And Maps
    3. Abstract Function Bodies When Possible
    4. Functions Should Be Testable
  17. Immutable Vs. Mutable
    1. Using Mutable Data Structures
    2. Using Immutable Data Structures
  18. Pattern Matching
    1. Do Not Pattern Match For All Statements
    2. Cover All Outcomes Of A Pattern Match
    3. Prefer Value Matches Over Guards When Possible
    4. Prefer To Map/Filter Over An Option Rather Than Pattern Matching
    5. Prefer Pattern Matching To Type Casting
  19. Lazy Val
    1. Cost Of A Lazy Val
    2. Common Usages Of Lazy Val
    3. Using A Factory And Lazy Val Pattern
  20. Oop
    1. Useless Traits
    2. Using Case Classes Effectively
    3. Instance Methods Invoking Static Methods
    4. No Classes Inside Of Package Objects
    5. Prefer Mixing Over Deep Inheritance
  21. Syntax
    1. Do Not Use The Return Keyword
    2. Do Not Use Exceptions For Validation And Flow Of Control
    3. Do Not Use Null
    4. Do Not Use Option.Get
    5. Explicit Return Types
  22. Concurrency
    1. Prefer The Actor Model Over Manual Runnable/Thread
    2. Always Prefer A Single Producer
    3. Thread Safety Of Public Apis
    4. Blocking I/O On A Separate Thread Pool
    5. Futures Are Not The End Answer
    6. Prefer An Ask Over Exposing Internal Actor Workings
    7. Actors Should Only Accept Data
  23. Advanced Language Features
    1. Avoid Postfix Notation
    2. Avoid Implicit
    3. Avoid Complex Structural Typing
    4. Avoid Dynamic Typing
  24. General Programming
    1. Proper Naming Of Variables And Functions
    2. Long Line Splitting
    3. Return Types For Methods
    4. Catch Exceptions When Possible
    5. Self-Documenting Code
  25. Conclusion
    1. Wrap Up And Thank You

Product information

  • Title: Scala Fundamentals
  • Author(s): O'Reilly Media, Inc.
  • Release date: August 2016
  • Publisher(s): O'Reilly Media, Inc.
  • ISBN: 9781491970843