DEV Community

Cover image for Into Programming - Basics-01
Kiran
Kiran

Posted on

Into Programming - Basics-01

In this article, I'm trying to explain the basics of programming languages as simple as possible. Let's start from the beginning...

Code:
A set of special instructions to tell the computer what to do. Usually, the code is saved in a text file.

Syntax:
It is the rules for valid format and combinations of instructions is called a computer language.
Tip:  While writing/Taking notes, enclosed syntax with a rectangle.

Statements:
A group of words, numbers, and operators that performs specific functions is called statements.
eg:  a = b + 2 ;     
 where 'a' and 'b' are variables,
2 is a value/literal value,
and +, = are operators

Expressions:
An expression is any reference to a variable(s) or value(s) combined with operators. Statements are made up of one or more expressions.
eg: a = b + 2;

This statement has four expressions in it. 
2 is literal value expression. 
b is a variable. 
b + 2 is an arithmetic expression. 
a = b + 2 is an assignment expression.

Note: A general expression that stands alone is also called an expression statement
eg: b+2

Top comments (0)