Semicolons are optional behavior
📖 Scenario: Imagine you are writing a simple Swift program to greet friends. Swift allows you to write code with or without semicolons at the end of each statement. This project will help you understand how semicolons work in Swift.
🎯 Goal: You will create a small Swift program that prints greetings to friends using semicolons optionally. You will see how semicolons can be used or omitted without changing the program's behavior.
📋 What You'll Learn
Create a variable with a friend's name
Create a variable with another friend's name
Print greetings to both friends using semicolons at the end of statements
Print greetings to both friends without semicolons at the end of statements
💡 Why This Matters
🌍 Real World
Knowing that semicolons are optional helps you read Swift code written by others and write your own code in a style you prefer.
💼 Career
Swift developers often write clean code without semicolons, but understanding them is important for reading legacy code or code from other languages.
Progress0 / 4 steps