Introduction to Programming Languages
In this article, I am going to give a brief Introduction to Programming Languages. Please read our previous article where we discussed how a computer works and also discussed the number system. At the end of this article, you will understand what is a language, computer language, programming languages and why we need a programming language, and what is the job of a programmer. Also, we will discuss software and types of software.
What is language?
Generally, languages are used to communicate with others. The languages like Odia / English / Marathi / Hindi are called human/regional languages, which are used to communicate with humans
A language is nothing but a set of instructions. So generally, if you take English language or Hindi language, the languages we are using to communicate. If we want to communicate with another person, we are passing instructions using a particular language. But while using a language, we need to follow some rules or you can say a set of instructions. For example, if I want to speak in English, I just want to form a sentence, to form a sentence, first, we should be grammatically good or else we cannot form a sentence.
What is computer language?
A computer language is also a set of instructions, or in other words, we can say that a set of programs, we give an application to understand.
Why do we need Computer language?
If one person wants to communicate with another person, generally, communication means they have to share the information which is nothing but passing some instructions. To do so, we are using general languages like English, Hindi, Odia, etc.
Communicating with the machine is a simple task. Just consider, if I am asking the question, what are the factorials of five? Everyone can answer easily id as 120, all right, it is a simple calculation. If, my next question is what is the factorial of 120? No one can answer because it’s a bit complex operation. This complex operation is performed by a computer using programs. But the computer only understands the binary language i.e. 0 and 1. That’s why there is a need for a programming language in order to communicate with computers.
If the person wants to communicate with the computer, the person needs to pass instructions in the machine code or binary code only i.e. a computer can understand only machine code or binary code. So that’s why first we have to learn one programming language properly. There are many programming languages like C, C++, Java, and C#. And all these are high-level programming languages.
So, for communicating with Computers, we write programs using any programming language. If you want to communicate with the computer using the C language, first you should learn the C language perfectly. After learning the language, you can write programs, program means a set of instructions. For example, A equals 10 and b equals 20 and c equals a plus b. We are taking two variables nothing but two values and we are adding and printing the result.
Programs get converted by Compiler and the output result gets generated on the screen. The compiler converts all these instructions into binary language or machine code. Now machine code is ready. So, once the machine code is ready you can pass it as an input to the computer.
The computer will produce the output. This is actually the process of communication with the computer. Directly we cannot communicate with the computer. We are communicating to perform complex operations in an easy way.
Imagine an ATM facility is not available and I just want to withdraw some amount of money from my account. How difficult it is, right. So, it is a long process, first I have to visit the bank, and then so much process I have to complete. And, finally, I will get the money. Suppose if machine availability is there, within one minute or two minutes you will get the money.
So, machines always make our tasks easy and this is the only reason we are communicating with the machines. Direct communication with the computer is not allowed because we cannot pass instructions in a binary language. So first we have to learn one programming language and after learning the programming language, we will write programs and then converting into binary instructions using the compiler.
What is an Interface?
It is not always necessary to be a programmer to communicate with the machines. An end-user also can communicate with the machine using an interface. The interface means without having the background details we can perform our tasks.
Just consider end user and user, the end-user wants to perform one ATM transaction, and the end-user can communicate using interfaces. For example, the end-user understands the English language, then the end-user clicks on English, then all the instructions will come in English language and operations will be performed.
What is happening in the background is not required for the end-user. For example, if you are driving a car, you just want to increase the speed of the car, you will accelerate generally. So, whenever we accelerate, the speed will increase but, what is happening in the background we don’t know.
Now we will learn, how this interface will communicate with different machines to complete the operations. The End user whenever enters how much amount they want to withdraw, it is communicating with the server machine, how it is communicating with a server machine, by a database machine that is not required to the end-user.
The end-user leaves the ATM center with the money. For any reason, if the transaction has failed, then the end-user directly contacts the bank management, and the bank management contact programmer because the programmer is providing the interface.
So, here, as a programmer, we are not communicating with the machines, we are just developing applications nothing but we are providing interfaces by which every end-user can easily interact with the machine and that is our motto.
Types of Computer Languages:
Basically, computer languages are divided into 3 types.
- Machine Language: Created with binary code [0, 1] and they are very difficult for the human being to understand. Example: 11100001
- Low level/assembly language: Created with English-like shortcuts called MNEMONICS. Example: Add, Sub, Subject, Subtract, Subway, Subscribe, Subscript, subordinate. It is also difficult to understand.
- High-level language: Created with simple English. Example: please, good morning, subject, addition, etc.
High-level features allow for designing application software like calculators, calendars, media players, etc., and low-level features are used to design system software like OS, device drivers, and translators. etc. Hence c is multi-purpose.
What is a Programming Language?
A Programming Language is a formal language, which comprises a set of instructions that is used to communicate with the computer. Programming Language is classified into two types:
- High-Level Programming Language
- Low-level Programming Language
For better understanding please have a look at the following image.
High-level and Low-level Programming Languages
We have already discussed machines understand only machine language and that language is in binary zeros and ones. Machine language is a low-level language that human beings can’t understand and only machines can.
So, when the machines were introduced initially, it was very difficult for people to write the program. At that time, machines are not used at the consumer level. Machines were used in laboratories only. The developers have to learn machine code. And the machine language was very tough, and it was used in the very initial stage.
Later, they thought that they should make some method or they should find some mechanism to make it easy to use machines. So, they introduce some language called Assembly language. The assembly language was a little easier than the binary language or machine language. Assembly language is used in system programming and to develop operating systems. Assembly language was a little easy and it can be taught and it can be learned and it can be practiced and can be used assembly language for writing programs. The assembly language was quite used for some time and this became a base for conversion from this language to machine language.
Assembly language is also a low-level language, it’s very difficult to learn. Suppose a class of 100 students is there and if somebody is teaching assembly language, then there are the chances of learning one student it right.
So, the learning curve is very high and it’s very difficult. As part of academics, students learn it for some time and they finish the exam and forget it.
So, at a low level, we have two languages i.e. Machine Language and Assembly language. As these two languages are very difficult to learn, we wanted some English-like language. English-like languages are high-level languages. They are not exactly like English and they are not more like machine code. They are in-between, which is easier for anybody to learn high-level languages. Nowadays, there is n number of high-level languages are available in the market which can be learned by any human being.
Examples of High-Level Languages are C, C++, Java, Python, C#, Visual Basic, Visual C++, etc. We call these languages programming languages because we can write programs by using these languages.
Assembly language is also a programming language but that is a low-level programming language and C, C++, Java, Python, C#, Visual Basic, Visual C++, etc. are high-level programming languages.
We are much familiar with the high-level language and these are easy to learn. No doubt for a beginner it is a little bit difficult in the beginning stage to learn a high-level programming language but when you learn any one of the high-level programming languages, then you can learn other languages very easily. You should learn one language thoroughly, then you can understand all other languages easily with minimum effort.
What is a Low-level Programming Language?
Low-Level Programming Languages are the languages that can be easily understandable to the system. These are system-dependent languages. In these two languages are there i.e.
- Machine Language
- Assembly Language
What is Machine-level language
Machine Language is the fundamental language for the system and it can be directly understandable without any translation. These are machine-oriented languages that use the collection of the binary of 1’s and 0’s.
The machine-level language is a language that consists of a set of instructions that are in the binary form 0’s or 1’s. As we know computers can only understand machine instructions, which are in binary digits, i.e., 0 and 1, so the instructions given to the computer can be only in binary codes.
Creating a program in a machine-level language is a very difficult task as it is not easy for programmers to write the program in machine instructions. It is error-prone as it is not easy to understand, and its maintenance is also very high.
A machine-level language is not portable as each computer has its machine instructions, so if we write a program on one computer will no longer be valid on another computer. That means the machine instruction of Windows OS is not going to be the same for Linus OS even not going to be the same for Mac OS.
The Assembly Language can be called Symbolic Language. In this language, different types of symbols will be used to design the program. But this assembly code is directly not understandable to the system so we require translators.
The assembly language contains some human-readable commands such as mov, add, sub, etc. The problems which we were facing in machine-level language are reduced to some extent by using an extended form of machine-level language known as assembly language. Since assembly language instructions are written in English words like mov, add, sub. So it is a little easier to write and understand as compared to machine language.
As we know that computers can only understand machine-level instructions, so we require a translator that converts the assembly code into machine code. The translator used for translating the code is known as an assembler. The assembly language code is not portable because the data is stored in computer registers, and the computer has to know the different sets of registers.
The assembly code is not faster than machine code because the assembly language comes above the machine language in the hierarchy, so it means that assembly language has some abstraction from the hardware while machine language has zero abstraction.
What is a High-level programming language?
The High-Level Programming Languages are syntactically similar to English and easy to understand. High-Level Programming Languages are user-dependent languages. A High-Level Programming Language is a combination of alphabets, digits, and symbols. It is called Micro Statements. By using a high-level programming language, we are developing user interface applications. Examples: C, C++, VC++, JAVA, C#, Swift, Objective C, D-Language.
Difference between High-Level and Low-Level languages:
The similarities between High-level language and low-level language are that both belong to the category of programming languages. The main difference between the high-level language and low-level language is that the Programmers can easily understand or interpret or compile the high-level language in comparison to machines. On the other hand, Machines can easily understand low-level language in comparison to human beings.
As a programmer, if we know the programming language then it is not possible to interact with computers because the computer can understand binary code only.
In the above case, recommended using a translator. As a programmer, if the instruction came in the programming language, the Translator will convert programming language code into binary format and according to every binary instruction, we will get an application or software.
What is Software?
Software is a collection of programs that uses the resources of the Hardware components. A Program is a set of instructions that are designed for a particular task. The set of programs is called software.
Let us understand this with an example i.e. Calculator. For each button, there is some program written inside it. That means a calculator is a collection of programs. And we can also say that a Calculator is software. That means the software is a collection of programs.
As per IT Standards, the software is a digitalized and automated process. Let us understand this with an example i.e. AC. If you set the timer to automatically off the AC after 1 hour, then after 1 hour the AC is going to be off. And again, using digits you can set the temperature of the AC. And these things are managed by software inside the AC.
Types of Software:
Software is classified into two types, i.e. System Software and Application Software. For a better understanding please have a look at the below image.
System Software is software designed for a general-purpose and does not have any limitations. It is basically designed to provide a platform for other software Systems. So, the Software does the functionality for the hardware devices like printers, mobile, processors, etc. System Software is classified into three types:
- Operating System: DOS, WINDOWS, LINUX, UNIX
- System Support: Compiler, Interpreter, Assembler
- System Development: Linker, Loader, Editor
Application Software is a program or group of programs designed for end-users i.e. designed for a specific task. Application Software does the functionality for business-oriented applications. Application Software is classified into two types:
- Application-Specific: MS OFFICE, Oracle
- General Purpose Software: Tally
In the next article, I am going to discuss How Computer Programs Work in detail. Here, in this article, I try to give a brief Introduction to Programming Languages and I hope you enjoy this Introduction to Programming Languages article.