When we think of programming, the first thing that comes out of every mind is C programming. Generally, people’s ideology is that, it is the first step in programming that one should start with and move on to different types of programming later. But here I am going to teach you entirely in a different perspective. At the end of this programming course, you will be able to code in different languages like C, Perl, Python. Later on, we will touch the OOPS concepts that started with C++ and is extended to many languages including Perl and Python. C does not support OOPS concepts. So, let’s get into the stuff.
What is a Program?
A computer program is a collection of instructions that can be executed by a computer to perform a specific task.
Example: Let us think you want the computer to perform basic math operation like addition, subtraction, multiplication or division. So, what you will do is you will instruct the computer to take two numbers given by you and you instruct it to perform one of the operations as mentioned above. The computer will do that operation and will give you the result on the monitor or display device. This entire process where you instructed the computer by writing a piece of code, so that computer can understand your requirement and perform the function is called a Program.
What is Programming Language?
A programming language is a formal language comprising a set of instructions that produce various kinds of output. In brief, whatever the program that you want to implement it can be implemented in various programming languages. The difference will be in their syntax and execution style which we will discuss going forward. You have to follow those syntax specific to that programming language for writing your program.
Programming languages are classified into 2 types. They are:
- High Level Programming Languages
- Low Level Programming Languages
High Level Programming Languages:
These languages are human understandable in nature, means human can only understand programs written in these languages as their syntax is made up of English words. They need an interpreter or compiler for the machine to understand them.
These are classified into 2 types. They are:
A) Procedure Oriented Programming Languages (POP)
B) Object Oriented Programming Languages
Low Level Programming Languages:
Low level languages can be understood by computer easily. It is also called machine language. It is mostly similar to Computer Instruction Set Architecture (ISA). These are closer to computer hardware.
These are classified into 2 types:
A) Assembly Language
B) Machine Language
|MACHINE LANGUAGE||ASSEMBLY LANGUAGE|
|A computer program written in machine language instructions that can be executed directly by computer’s CPU.||A low level programming language in which there is a strong correspondence between the program’s statements and the architecture’s machine code instructions|
|It is represented in binary format which consists of only zeros and ones||Syntax is similar to the English language|
|Only understood by the CPU||It is understood by the Programmer|
|Depends on the operating system or platform||Consists of set of standard instructions called ISA|
|Can be directly executed by the CPU to perform the defined tasks in the computer program.||Used by applications such as real time systems and micro-controller based embedded systems|
|Ex: 100010110100100001||Ex: LDA 2004H; STA 4132H; ADD A, B|
What is Compiler and Interpreter. What is the difference between them?
A compiler translates the entire source code into machine language before the source code is executed. Examples of compiled languages include C and C++
An Interpreter translates the source code line by line into machine language before the source code is executed. Examples of interpreted languages include Perl and Python.
|Transforms the entire source code||Transforms the source code line by line|
|Generates machine code||Does not generate machine code|
|More memory is used||Less memory is used|
|Compiled once and runs anytime||Source code is interpreted each time|
|More difficult to debug||Easier to debug|
See you soon with the next content. Stay tuned to the blog. Happy learning.