Programming Concepts: Data Types

Programming involves a very methodical approach to problem solving. In this process, there are rules that help maintain the order and legibility of the code. Some of these rules involve Data Types.

These data types help to segregate and limit the type of data that is held or processed by the code. For example, if you needed to record a user’s credit card number, it would be relevant to use a data type that stores numbers only. This would increase efficiency and validation in the code. Although programming languages have data types that are peculiar to them, they are all based on certain broad principles that we will discuss here. The standard data types are as follows:

Numbers - In programming, numbers are stored based on their length and as such they are generally divided into the Short, Long, Float and Double types. The first two refer to smaller and larger integer ranges while the latter refers to smaller and larger floating point ranges.

Characters and Strings - Again these types are based on memory requirements. Character types can record only one character at a time, whereas String types can take in large sequences of characters. Their use is typically governed by the type of operation that is required as well the amount of memory available.

Pointers - As their name suggests, these are references used to locate data in the computer’s memory. Use of pointers requires a deeper understanding of the workings of the code and computer memory. Used often with Arrays, pointers are very useful for tracking and sorting data.

This is a very basic description of data types. As you delve into programming, you will gain a better understanding of the varied types that stem from these basic types.

This entry was posted on Sunday, February 14th, 2010 at 9:26 am and is filed under Development. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Leave a Reply