What is the difference between a “function” and a “procedure”?

Generally speaking, we all hear about the functions or procedures in programming languages. However, I just found out that I use these terms almost interchangeably (which is probably very wrong). So, my question is: What is the difference in terms of their functionality, their purpose and use? An example would be appreciated. 18 Answers 18

What is “lifting” in Scala?

Sometimes when I read articles in the Scala ecosystem I read the term “lifting”https://stackoverflow.com/”lifted”. Unfortunately, it is not explained what that exactly means. I did some research, and it seems that lifting has something to do with functional values or something like that, but I was not able to find a text that explains what … Read more

How to explain callbacks in plain english? How are they different from calling one function from another function?

How to explain callbacks in plain English? How are they different from calling one function from another function taking some context from the calling function? How can their power be explained to a novice programmer? 33 Answers 33 I am going to try to keep this dead simple. A “callback” is any function that is … Read more

Static vs class functions/variables in Swift classes?

The following code compiles in Swift 1.2: class myClass { static func myMethod1() { } class func myMethod2() { } static var myVar1 = “” } func doSomething() { myClass.myMethod1() myClass.myMethod2() myClass.myVar1 = “abc” } What is the difference between a static function and a class function? Which one should I use, and when? If … Read more

“Parameter” vs “Argument” [duplicate]

This question already has answers here: What’s the difference between an argument and a parameter? (36 answers) Arguments or parameters? [duplicate] (12 answers) Closed 2 years ago. I got parameter and argument kind of mixed up and did not really pay attention to when to use one and when to use the other. Can you … Read more

What is the difference between a ‘closure’ and a ‘lambda’?

Could someone explain? I understand the basic concepts behind them but I often see them used interchangeably and I get confused. And now that we’re here, how do they differ from a regular function? 15 s 15 There is a lot of confusion around lambdas and closures, even in the answers to this StackOverflow question … Read more