Member-only story
Imperative vs. Functional Swift Programming
What are they? Which should you use?
4 min readMay 18, 2022
This article contains content previously published on Medium
Difficulty: Beginner | Easy | Normal | Challenging
This article is best used in conjunction with the Swift Playground which can be found here: https://github.com/stevencurtis/SwiftCoding/tree/master/ImperativeVsFunctional
Prerequisite Articles:
- Coding in Swift Playgrounds will help you be able to use the playground available for you to download
- Using SwiftUI in Playgrounds will help you use Playgrounds with SwiftUI
- Map is used within the article, as are Arrays and for loops
Terminology
Declarative programming: a programming paradigm which expresses a computation directly as pure functional transformation of data
Functional programming: a form of declarative programming. In itself, a programming paradigm which uses statements to change state