Monday, August 02, 2010

Data type

In programming language, we have something called data type. We have it because any program would process data only. If the data type is well declared and defined in a programming language, it is a strong typed language; otherwise it is a weak typed language. If the data is well defined, its operation is clear enough; otherwise there are many unknown outcomes for different unexpected scenarios.

It looks like mathematics. We have sets, number sets. We can define our own sets and we also have some pre-defined sets such as Integers, Real Numbers and Complex Numbers. The name of these pre-defined sets is reserved in certain sense. The concept of reserved words is similar to this one. Besides sets, we have operators like '+','-','x' to manipulate the numbers, members of the given sets.

In programming, data type is not limited to numbers. It includes characters and even strings. Here, characters does not mean any tool or persons in the movies. We are talking about members of alphabet, the letters, the puntuation marks and other symbols.

Typically, we write some functions to manipulate these data for us. It normally takes serveral input and generates a datum as output. It works like a function in mathematics. It maps the parameters in given sets to a value in another set. It tells us a clear relation.

How about the function of your mind? How can we understand and handle the data from the external world? Firstly, we tends to categorize them. Category is one of the key concept in our mind. Secondly, category helps us to compare and associate the current instance of event with the past events. It helps to manage the expectation. Thirdly, we can take the procedure from our experience or external authority to deal with the current situation. Hence, category on low level is data type in our mind.

Our mind is much more advanced. We have self-awareness and self-reflection. We can handle meta-level thinking. We can apply category on other categories. We can understand the logic of our thinking.

In fact, compilers of some computer programming language can be implemented by itself. It means it has reflection mechanism to describe itself. It is similar to metadata for database and meta-language for language.

Language somehow governs our thinking and communication. If everyone has kept its very own version of interpretation on public affairs, it would create chaos. It is the reason why we need objectivity and objective language in law. It helps us to categorize different real life scenarios and measure them with objective scales such that we can handle them in a systemetic way under the principle of fairness and justice.

No comments: