Data Types (in computer programs)
It’s important to specify the right data type for your data structures because the program needs to know what type of values an object can store and which operations can be successfully performed using it.
Failure to use the correct data type may result in you losing the ability to perform sorts or calculations using the data.
Common Data Types
The names that we give to certain data types can change from one programming language to another, but here is a list found in many:
|Data Type||Description||Example Data|
|String||Alphanumeric characters, text||“I am a string”|
|Real||Numbers that may have decimal places||15.7|
Please note the use of quotation marks to indicate a string of text or single character. String values without quotation marks will be mistaken for variables.
Also note the lack of quotation marks for the boolean value of TRUE. This is because it is a logical state of being, not the storage of the string “TRUE”.