Types Of Data In Programming

Types Of Data In Programming

Introduction

No alt text provided for this image

A data type is a classification of data which tells the compiler or interpreter how the programmer intends to use the data. Most programming languages support various types of data, including integer, real, character or string, and Boolean.


Common data types used in programming

  • Integer (int) : It is the most common numeric data type used to store numbers without a fractional component (-707, 0, 707).
  • Floating point (float) : It is also a numeric data type used to store numbers that may have a fractional component, like monetary values do (707.07, 0.7, 707.00). 
  • Character (char) : It is used to store a single letter, digit, punctuation mark, symbol, or blank space. 
  • String (str or text) : It is a sequence of characters and the most commonly used data type to store text. Additionally, a string can also include digits and symbols, however, it is always treated as text.
  • Boolean (bool) : It represents the values true and false. When working with the boolean data type, it is helpful to keep in mind that sometimes a boolean value is also represented as 0 (for false) and 1 (for true). 
  • Enumerated type (enum) : It contains a small set of predefined unique values (also known as elements or enumerators) that can be compared and assigned to a variable of enumerated data type. The values of an enumerated type can be text-based or numerical. In fact, the boolean data type is a pre-defined enumeration of the values true and false.
  • Array : Also known as a list, an array is a data type that stores a number of elements in a specific order, typically all of the same type. Since an array stores multiple elements or values, the structure of data stored by an array is referred to as an array data structure. 
  • Date : Typically stores a date in the YYYY-MM-DD format.
  • Time : Stores a time in the hh:mm:ss format. Besides the time of the day, it can also be used to store the time elapsed or the time interval between two events which could be more than 24 hours.
  • Datetime : Stores a value containing both date and time together in the YYYY-MM-DD hh:mm:ss format.
  • Timestamp : It is typically used by computer systems to log the precise date and time of an event, down to the number of seconds, in a format that is unaffected by time zones. Therefore unlike datetime, the timestamp remains the same irrespective of our geographical location. 

Importance of data types

No alt text provided for this image

We might be wondering why it is important to know about all these data types when we are mainly concerned with understanding how to leverage customer data. There is only one main reason — to gather clean and consistent data. Our knowledge of data types will come handy in two stages of our data collection efforts as described below. 

Conclusion

Application of our knowledge on data types is not limited to data collection or instrumentation; other activities such as data integration and internal application development (using no-code or low-code tools) should also become a lot easier now that we understand the various data types. 

References:

7 Data Types: A Better Way to Think about Data Types for Machine Learning. Retrieved from https://towardsdatascience.com/7-data-types-a-better-way-to-think-about-data-types-for-machine-learning-939fae99a689

Computer Programming - Data Types. Retrieved from https://www.tutorialspoint.com/computer_programming/computer_programming_data_types.htm

Data Types. Retrieved from https://press.rebus.community/programmingfundamentals/chapter/data-types/

What are Data Types and Why are They Important? Retrieved from https://dataled.academy/guides/data-types/

To view or add a comment, sign in

More articles by Muhammad Ikhmal Sofian

  • The Mighty Little Rain Sensor

    The Rain Sensor Rain sensors are a type of switching device that is used to detect rainfall. It operates like a switch.

  • Soil Moisture Sensor : How Does It Works?

    What Is A Soil Moisture Sensor? A soil moisture sensor is a sensor which used to measure estimate the amount of water…

  • Wi-Vi : A Byakugan-like Technology

    Byakugan in Naruto: Shippûden The Byakugan (白眼, literally meaning: White Eye, meaning (Viz): All Seeing White Eye) is a…

  • Organic Light Emitting Diode (OLED)

    What Is An Organic Light Emitting Diode (or OLED)? Organic Light Emitting Diode (or OLED) is a type of LED with a small…

  • Quantum Electronics : A Brief Description

    Introduction to quantum electronics Quantum electronics is the field of physics and technology that deals with methods…

  • MAGLEV Train : How Does It Works?

    What is meant by maglev? Maglev (from magnetic levitation) is a system of train transportation that uses two sets of…

  • Electronics and Physics : What Should Be Known?

    Introduction Physics is the study of matter, energy, and the relationship between them. It is a natural science based…

  • Mathematical Structure For Computer Science

    Introduction Unlike science, which investigates the natural world, or political science, which analyzes the…

  • Multimedia and Its Applications

    What is multimedia? Multimedia is the field concerned with the computer-controlled integration of text, graphics…

  • Automated Dinosaur Game With Arduino

    Introduction The Dinosaur game which is also known as the Chrome Dino is a built-in browser game in Google Chrome. It…

Others also viewed

Explore content categories