0PricingLogin
Scala for Backend Engineering & Functional Programming · Lesson

Control Structures and Functions

Learn about conditional expressions (if/else), loops, and defining simple functions in Scala.

Guide Your Code's Path

Imagine your program as a journey. Sometimes you need to make decisions, like taking a left or right turn. Other times, you need to repeat an action, like walking several steps.

Control structures are tools that let your code make these decisions and repeat actions. They determine the order in which statements are executed, guiding the flow of your program.

Conditional Logic: If/Else

The most basic control structure is the if/else expression. It allows your program to execute different blocks of code based on whether a condition is true or false.

In Scala, if is an expression, meaning it always returns a value. This is a powerful feature compared to many other languages where if is just a statement.

All lessons in this course

  1. Getting Started with Scala
  2. Basic Syntax and Types
  3. Control Structures and Functions
← Back to Scala for Backend Engineering & Functional Programming