{"rsdb":{"rid":"309165","subhead":"","postdate":"0","aid":"224327","fid":"77","uid":"1","topic":"1","content":"
\n \n \n
\n \n

\"Data model\" is a terminology appeared in the official python<\/a> language reference. In the model inplemented by python<\/a>, objects are python's abstration for data.
<\/p>\n

It is worth mention that python has a different language architecture as oposed to C++<\/a>. In python, everything can be regarded as an object. Here I quote from https:\/\/docs.python.org\/3\/reference\/datamodel.html: \"In a sense, and in conformance to Von Neumann's\n model of a 'stored program computer,' code is also represented by objects.). Under this framework, object is everywhere in python, it is the basic component of a python program, which I believe, make python an object driven programming language.
<\/p>\n


<\/p>\n

In C++<\/a>, not everything can be seen as an object. \nActually, t<\/span>he entities (component\uff09of\n a C++ program are values, objects,references, functions, enumerators, types, class members, templates, template\n specializations, namespaces, parameter packs, and |this| pointer<\/span><\/span><\/span><\/span><\/span><\/span><\/font>. Objects, in terms of one class, is only a component in C++ and is designed to be existed parallelly with values, functions, types, etc. In another\n word, a C++ object is associated with a type, a value, etc. They all have the same weight under C++ architecture. Type, value, and other \"properties\" (as you may refer it), is not regarded to exist as data blocks attached to objects. Object is not the first\n class citizen in C++.<\/p>\n


<\/p>\n

In python, variable is a mechanism that acts as a n-to-1 mapping which links a specific literal (name\/alphabet sequence, called identifier) in the program to a memory space.<\/p>\n

After the execuation of the following code:
<\/p>\n

###code start
<\/p>\n

a=1<\/p>\n

#the memory address of 1 is 0x0000
<\/p>\n

b=a<\/p>\n

###code end
<\/p>\n

literal \"a\" and \"b\" would both represent a memory address: 0x0000. When eva luating, the value stored in the memory space represented by the identifier is obtained.
<\/p>\n


<\/p>\n

In contrast, variable in C++ is a mechanism that acts as a 1-to-1 mapping which links a identifier in the program to a specific value. The identifier has an implicit associated memory space which is fixed (thus C++ is called to be a static language).
<\/p>\n

<\/p>\n

After the execuation of the following code:
<\/p>\n

###code start
<\/p>\n

a=1<\/p>\n

#the memory address of a is 0x0000, in which 1 is stored
<\/p>\n

b=a<\/p>\n

#the memory address of b is 0x0001, in which 1 is stored
<\/p>\n

###code end
<\/p>\n

literal \"a\" and \"b\" would both represent a memory address: 0x0000. When eva luating, the value stored in the memory space implicited associated by the identifier is obtained.
<\/p>\n


<\/p>\n


<\/p>\n <\/div>\n <\/div>","orderid":"0","title":"Python, C++ Comparision from AN OOP Programmer's Perspective","smalltitle":"","mid":"0","fname":"Python","special_id":"0","bak_id":"0","info":"0","hits":"47","pages":"1","comments":"0","posttime":"2019-05-16 02:49:45","list":"1557946185","username":"admin","author":"","copyfrom":"","copyfromurl":"","titlecolor":"","fonttype":"0","titleicon":"0","picurl":"https:\/\/www.cppentry.com\/upload_files\/","ispic":"0","yz":"1","yzer":"","yztime":"0","levels":"0","levelstime":"0","keywords":"
Python<\/A> Comparision<\/A> from<\/A> OOP<\/A> Programmer'<\/A> Perspective<\/A>","jumpurl":"","iframeurl":"","style":"","template":"a:3:{s:4:\"foot\";s:0:\"\";s:8:\"bencandy\";s:0:\"\";s:4:\"head\";s:0:\"\";}","target":"0","ip":"47.106.78.186","lastfid":"0","money":"0","buyuser":"","passwd":"","allowdown":"","allowview":"","editer":"","edittime":"0","begintime":"0","endtime":"0","description":" \"Data model\" is a terminology appeared in the official python language reference. In the model inplemented by python, objects are python's abstration for data.It is worth mention that..","lastview":"1714063901","digg_num":"0","digg_time":"0","forbidcomment":"0","ifvote":"0","heart":"","htmlname":"","city_id":"0"},"page":"1"}