Data Types and Variables Explained
3/18/2023
Computer Programming
Beginners
FreelancingFull stack web developmentfrontendbackendAPIsServersLinuxUbuntuDigital Oceanprogramming languagestech stacksresourcesbest resourcesbest youtube channelsbest websitesweb developmentself-taught programminghow to freelance as a programmerpythonDjangoreactjshtmlcssjsframeworksetc.
Data Types and Variables Explained
The world of computer programming has a lot of jargon and concepts, and it can be overwhelming, especially if you are a beginner. One of such interesting concepts, is data types and variables. In this blog, we will briefly explain data types and variables.What are Data Types?
Data types, in programming, refer to categories of values that a computer can think with. Data types denote the kind of data a particular programming language can manipulate and its associated operations. In other words, data types denote which specific category of data can be stored, accessed and manipulated in memory.Types of Data Types
Data types can be broadly classified into two major categories:- Primitive Data Types: These are the most basic data types, and they include Integer, Float, Character, Boolean and Void.
- Complex Data Types: These are the advanced data types, and they include Arrays, Pointers, Structures and Unions.
What are Variables?
Now that we have an understanding of data types, let’s talk about variables. Variables are nothing but names assigned to areas of memory that can store data. In other words, they act as a placeholder for a particular value. Variables are declared with a specific data type and then can be used to manipulate data accordingly. Variables in different languages are represented differently. For example, in JavaScript variables are declared using the ‘let’ keyword while in Python they are declared using the ‘var’ keyword.Types of Variables
Variables can be classified into two types -- Local Variables: These are the variables that are declared inside a function and are available only inside that function. They cannot be accessed outside of it.
- Global Variables: These are the variables that are declared outside any function and are available across the program.