This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
With the rapid growth of languages and framworks such as Swift and React you may have heard the terms functional, declarative, and immutability more often. It's often contrasted with the term "imperative". Many authors of technical blogs will assume that you know are familiar with what these terms mean but since so many developers are self taught (particularly in web and mobile programming) it's a big assumption that the reader is comfortable with these terms. | |
When these terms are described to a developer they may offer the responses, "I have no idea what you are talking about" or "Oh, that makes sense. Isn't that just called...uh...programming?". Of course if you've only programmed in a certain domain you may only be familiar with one particular paradigm. Describing a paradigm as "data and behavior are encapsulated as objects and these objects can influence and change other objects by passing messages" may sound insane to a developer that has only worked with Haskell, but a Java developer would be right at |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Delay function | |
func delay(_ seconds: Double, completion: @escaping ()->Void) { | |
DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + .milliseconds(Int(seconds * 1000.0))) { | |
completion() | |
} | |
} | |