DEV Community

Cover image for The basics of Programming
Ashutosh Bhadauriya
Ashutosh Bhadauriya

Posted on • Edited on

The basics of Programming

Hello 👋 Coders, This is my first blog post so thought why not cover the basics as it will be easy for me to start with and easy for you to understand if you're beginning your coding journey.

So, let's start with one step at a time..

What is Programming?

Programming is the process of giving computer intructions on how to act. Yes, this is it. Wait wait..how can one give instructions of computer. Do Computers understand us? The answer is no, Computers cannot understand us. They understand only binaries (0 and 1). The instructions that we give them are given through code.
This code can be in various programming languages.

Programming language is a language that is used by programmers to communicate with computers. It is a set of instructions written in any specific language like C++, Java, Pyhton, etc.

There are five basic concepts in any Programming Language..

  • Variables
  • Conditional Statetments
  • Looping & Iteration
  • Data types and Data Structures
  • Functions

Variables

Consider them a boxes, that are used to store data or reference to data. There can be many properties of variables like a name, type, value, scope, lifetime and location. We'll discuss them in details in my future posts as this is out of scope for now.

Conditional Statements

These statements are also known as "if-else" statements, and it is as simple as it sounds. Yeah, you guessed it right. If the given condition satisfies do this or do that (execute else codition).

Iteration & Looping

Let me ask you something. What if you want to print some statement more than 100 times. What will you do? OK OK I am not considering that your typing speed is 200 wpm. Even if you have, why will you type something again and again if you can do the same in less than 3 lines. Here comes iteration and looping. If program repeats a sequence or process, that is an iteration. Loops are a type of iteration, where a program carries out an action until new condition is met. In easier words, you will not need to write the same thing again and again.

Data Types & Data Structures

A Data Type is the most basic classification of a data. So, basically it is the type of any variable used in the code. Some of the basic examples are int, double , string, etc.

Data Structures on the other hand are a collection of data types. It is a way of organizing the items in terms of memory, and also the way of accessing each item through some defined logic. Some examples of data structures are stacks, queues, linked lists, binary tree and many more. I know this might be too much. Don't worry about them now, you do not need to deal with them initially.

Functions

A function is a contained block of code that can perform an action. For now you can remeber them as they are the "something" which can be used multiple times in a program and allows use to reuse the same piece of code instead of writing it again and again.

This was it? Write down in comments and let me know if it was helpful.

Top comments (0)