… and the meaning assigned to the assignment
In essentially every programming language that we regularly use, there is a mechanism which let programmers access information available in the program using symbolic names: the “variables”. It is taught early in nearly every introductory programming class, so every programmer should fully understand it.
Except that it is not the case. Even programmers having long histories of writing software are usually caught confused with the very concept of variables, leading to fragile code and reduced productivity.
Part of the problem is that the concept is so important, that it is taught in very early stage, when learners cannot be expected to understand the full complexity. Another problem is that there are actually two very different but both mainstream systems of the variable, and learners expect that concepts in one system automatically transfer to the other–which is not the case. Now, when you are already in the software development industry, it is time for a change.
In this article, we inspect the two main systems of variables: the reference-based system and the value-based system. Hopefully, this will clear up all the confusion.
The reference-based system
The value-based system
Relation between value-based and reference-based system
The functional system