Swift for Beginners / Chapter 1 — Getting started (lessons 1–8) / Lesson 1
What Swift is (setting up and Hello World)
Time needed: about 3 min (estimate)
Reading settings
These settings are remembered on this device only.
You can try the opening of this lesson without an account.
What kind of language Swift is
Swift is a language Apple announced in 2014.
Three of its properties are worth knowing.
First, it is type-safe and compiled — the types of variables and functions are settled before you run, and any contradiction is a compile error.
You never have the accident of "I ran it and found I was adding a string to a number".
Second, it is not a language for iOS and macOS apps alone.
It is open source, runs on Linux and Windows, and is used for server-side work (Vapor) and command-line tools.
Third, it is designed to make safe code easy to write.
Optionals expressing nil in the type, constants that cannot be changed by default, arithmetic that does not let overflow slip past — the policy of closing off the bug-prone places in the language itself runs throughout.
swift --version
You do not need Xcode
Create a free account to keep reading
With an account you can read the rest of this lesson, take the quiz, and read every free lesson in this course. Lessons you answer correctly are recorded as complete.
Report a problem with this lesson
Log in to send a report.