Re: "Why is it necessary to classify data according to its type in computer programming?"

Fred Nurk <albert.xtheunknown0@xxxxxxxxx> wrote:

It is necessary to classify data into different types because a computer
must use a system of codes to classify the data processed.

That's my answer (which I've tried to take from my textbook) to this
thread's subject.

My textbook has this paragraph:
A data type refers to how the computer classifies data. We can all see at
a glance whether data is numerical or expressed as a percentage or
currency but a computer must use a system of codes to classify the
different types of data that are processed. The different data types in
computer programming include integers, characters, Boolean, floating
point numbers, real numbers, dates, pointers, records, algebraic data
types, abstract data types, reference types, classes and function types.

Does my answer make sense? Could I do a better job of showing my
understanding of the importance of data types using the textbook

A computer must classify data according to its type for the same reason
a person must classify information according to its type. We classify
the data in order to determine what operations can meaningfully be
applied to that data.

The question is quite existential and belongs in a philosophy class
rather than an computer class. For a computer class, it should be enough
to understand that the program must be able to classify data according
to its type, and then discuss the different means by which a program can
do that.

Relevant Pages