Definitions

Pointer

A pointer tells you where a value is located, just like a street address tell you where a house is located. By visiting that address, you can change what is stored there.

When programmers use the term “dereferencing”, all they mean is that they are visiting the pointer, a.k.a the address, and doing something with the value stored there.

Definitions

Procedure

Procedures encapsulate a set of instructions so they can be reused in multiple locations, instead of copying those instructions to multiple locations. This reduces the size of code.

A procedure is not a function because it does not return a value.

Definitions, Function

Function

From a pure mathematical standpoint, a function is an expression that maps a set of inputs to a set of outputs. Each selection of inputs is guaranteed to always produce the exact same output.

In programming terms, a function is a specialized procedure that reserves space to return a value.

For a function to be considered a Pure Function the values passed to the function must be duplicated, a.k.a passed by value, so as to prevent the original values from being altered.