QQ交谈 +852 2655 6100 enquiry@clustertech.com

The various meanings of variables


… 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

1.Object

2.Variable

3.Collection convention

 The value-based system

1.Value

2.L-value

3.Pointer

 Relation between value-based and reference-based system
 The functional system
 Conclusion

Author: Isaac

Improve your experience on our website

We notice that your current browser is out of date. In order to improve your experience on our website, we suggest that you upgrade your browser. Upgrading should only take a few minutes. If you are already using the most updated version, please turn off the Compatibility Mode of your browser.

最佳的瀏覽體驗

為獲取最佳的瀏覽體驗,我們建議您升級瀏覽器。如您已在使用最新版本的瀏覽器,請關閉瀏覽器相容模式以訪問網站。

最佳的浏览体验

为获取最佳的浏览体验,我们建议您升级浏览器。如您已在使用最新版本的浏览器,请关闭浏览器相容模式以访问网站。

<a target="_blank" href="http://www.getfirefox.com/">Mozilla Firefox</a><a target="_blank" href="http://www.google.com/chrome/">Google Chrome</a>