Sat. Jan 21st, 2023

Use and application of data types in software

All data is represented using binary. fundamentally there is nothing different about a large array of integers, and an image: both are a collection of binary data.

Software must therefore dictate what the data represents, so that it can be processed appropriately.

Most modern languages are strongly typed: this means that variables are assigned a data type, and this remains valid for as long as the item is in scope.

There is a list of standard data types, called primitives, that exist in most languages:

  • Boolean
  • Integer
  • Character
  • Floating point

A data-primitive is a value which can be stored in a single memory location.

Extending primitive data types

Primitive data types are useful, but aren’t necessarily ideal for representing everything. For example, it is useful as a programmer to design classes which aggregate attributes together along with methods.

Modern languages allow for the developer to create their own data types, which more closely model the entities referred to in the code.