At the end of this lesson-
- 1. You will be able to describe programming languages of different generations.
- 2. You will be able to describe programming languages of different levels.
- 3. You will be able to explain characteristics, advantages and disadvantages of machine language.
- 4. You will be able to explain characteristics, advantages and disadvantages of assembly language.
- 5. You will be able to explain characteristics, advantages and disadvantages of High level programming language.
Program: A program is a collection of instructions written by a programmer in a programming language to solve a particular problem by machine.
Programming: Giving instructions to a machine using a programming language is called programming. In other words, The process or technique of developing and implementing various sets of instructions to enable a computer to do a certain task.
Programmer: A programmer, developer (“dev”), coder, or software engineer is a person who writes program in a programming language to solve a particular problem by machine.
Programming Language: The language which is used to give instructions to the machine to solve a particular problem is called programming language. In other words, A programming language is a vocabulary and set of grammatical rules for instructing a computing device or machine to perform specific tasks. The programming languages such as BASIC, C, C++, COBOL, Java, FORTRAN, Ada, Pascal etc.
Types of Programming Language: Programming languages invented from 1945 to today are divided into five generations according to features.They are-
- 1. First Generation(1945-1949)
- -Machine Language
- 2. Second Generation(1950-1959)
- -Assembly Language
- 3. Third Generation(1960-1969)
- -High Level Language
- 4. Fourth Generation(1970-1979)
- -Very High Level Language
- 5. Fifth Generation(1980-present)
- -PROLOG, LISP, Mercury, Natural Language
Again, Programming languages can be divided into five levels based on their characteristics of program development:
- 1. Low Level Language
- -Machine Language, Assembly Language
- 2. Mid Level Language
- -C, Forth, Dbase, WordStar
- 3. High Level Language
- -Fortran, Basic, Pascal, Cobol, C, C++, Visual Basic, Java, Oracle, Python
- 4. Very High Level Language- 4GL
- -SQL, Oracle
- 5. Natural Language
- -Human Language
Machine Language: The language in which only 0 and 1 are used to write a program is called machine language. This is the basic language of computers or any computing devices. Machine language is the only language a computer is capable of understanding. Using this language it is possible to communicate with computers directly. Machine language is first generation and low-level programming language. The program written in machine language is called object program.
Advantages of Machine Language:
- 1. It is directly understood by the computer that’s why it is possible to communicate with computers directly.
- 2. The main advantage is that program of machine language run very fast because no translator program is required for the CPU.
- 3. Program written in machine language needs less memory.
Disadvantages of Machine Language:
- 1. It is very difficult to learn and program in machine language as only 0 &1 are used.
- 2. A program written in machine language is almost impossible to understand by human.
- 3. It takes more time to write a program in machine language and It is difficult to debug the program.
- 4. This language is machine dependent. That means a program written for one computer might not run in other computers with different hardware configuration.
- 5. The programmer has to know details of hardware to write a program in machine language.
Assembly Language: The language in which different mnemonics are used to write a program is called assembly language. In this language alphanumeric symbols are used to write programs instead of 0’s and l’s. These alphanumeric symbols are known as mnemonic codes and can combine in a maximum of five-letter combinations e.g. ADD for addition, SUB for subtraction, DIV for division,MUL for multiplication etc. Because of this feature, assembly language is also known as ‘Symbolic Programming Language. Assembly language is second-generation language and low-level language. It was mostly used programming language for second generation computers. A translator program is required to translate the Assembly Language to machine language. This translator program is called `Assembler’.
In assembly language there are four parts in every instruction. Such as-
Label: A label in a programming language is a sequence of characters that identifies a location within source code. By using label program execution can jump from one statement to another statement. A label consists of one or two alphanumeric characters and cannot have any space between characters. A mnemonic can not be used as a label. A colon(:) sign is used after a label. For example- BB:
Op-code: Op-code is also called operational code. Op-code is a mnemonic having instruction. These mnemonics can be different in different computers. Some mnemonics and their functions are-
|LDA||Instruction for loading accumulator with data of main memory.|
|STA||Instruction for storing data of accumulator in particular place.|
|CLR||Instruction to clear accumulator.|
|ADD||Instruction for adding the value of operand with accumulator and store the result in accumulator.|
|SUB||Instruction for subtracting the value of operand from accumulator and store the result in accumulator.|
|MUL||Instruction for multiplying the value of operand with accumulator and store the result in accumulator.|
|DIV||Instruction for dividing accumulator by the value of operand and store the result in accumulator.|
|JMP||Instruction for unconditionally jumping to a certain point of the program.|
|INP||Instruction for receiving data or instruction and storing in particular place of memory.|
|OUT||Instruction to send data from the particular place of memory to the output.|
|STP||Instruction to stop the program.|
Operand: Operand is on which the op-code works. It could be memory address or actual data.
Comment: Comments that explain instruction but not part of it. Comments are written for instruction so that in future any programmer can understand the meaning of the program and can modify the program easily.
Advantages of Assembly Language:
- 1. Assembly language is easier to understand and write a program as compared to machine language.
- 2. It saves a lot of time and effort to write a program.
- 3. It is easier to correct errors and modify program instructions.
Disadvantages of Assembly Language:
- 1. One of the major disadvantages is that assembly language is machine dependent. A program written for one computer might not run in other computers with different hardware configuration.
- 2. Since it is machine dependent, the programmer also needs to understand the hardware.
- 3. It needs translator program.
High Level Language: High-level programming languages mean that the languages are easily understandable and close to human language. These languages are similar to human language like English and machine independent that’s why these language is called high level programming language. These languages are easy to understand for people but computers can not understand directly. So it needs to convert the program written in high level language into machine language using a translator program. These languages are called third generation language. Some examples of high level programming languages are Fortran, Basic, Pascal, Cobol, C, C++, Visual Basic, Java, Oracle, Python etc.
Types of High Level Programming Language:
Based on the application of high level languages they are two types-
General Purpose Language: These type of languages are suitable for all kinds of functions. Such as- BASIC, PASCAL, C etc.
Special Purpose Language: These type of languages are suitable for only special kinds of functions. Such as- COBOL, ALGOL, FORTRAN etc.
Advantages of High Level Language:
- 1. High level languages are programmer friendly. They are easy to learn as well as easy to write and maintain the program.
- 2. Less error prone, easy to find bug and debug.
- 3. The programmer need not to know details of hardware to write a program .
- 4. It is machine independent language.
- 5. High level programming results in better programming productivity.
Disadvantages of High Level Language:
- 1. Cannot communicate directly with the hardware.
- 2. It needs translator program and It takes additional translation times to translate the source to machine code.
- 3. High level programs are comparatively slower than low level programs.
- 4. Compared to low level programs, they need more memory space.
Application of High Level Language:
- 1. To develop a large application software.
- 2. To develop application package software.
- 3. To develop software for automated process control etc.
Introduction to some popular high level programming languages:
C: C is a general-purpose, structured or procedure, high-level language that was originally developed by Dennis M. Ritchie to develop the UNIX operating system at Bell Labs. It is also popular as mid level language. C was originally first implemented on the DEC PDP-11 computer in 1972. C was invented to write an operating system called UNIX. C is a successor of B language which was introduced around the early 1970s and B is successor of BCPL(BCPL-Basic Combined Programming Language) developed by Martins Richards.
C++: C++ is a programming language that supports procedural, object-oriented, and generic programming. It was developed by Bjarne Stroustrup starting in 1979 at Bell Labs in Murray Hill, New Jersey, as an enhancement to the C language and originally named C with Classes but later it was renamed C++ in 1983. C++ is a superset of C.
Java: Java programming language was originally developed by Sun Microsystems which was initiated by James Gosling and released in 1995 as core component of Sun Microsystems’ Java platform (Java 1.0 [J2SE]). Java is platform independent and an object-oriented Language.The language, initially called ‘Oak’ after an oak tree that stood outside Gosling’s office, also went by the name ‘Green’ and ended up later being renamed as Java, from a list of random words.
Python: Python is a widely used general-purpose, high level programming language. It was initially designed by Guido van Rossum in 1991 and developed by Python Software Foundation. It was mainly developed for emphasis on code readability, and its syntax allows programmers to express concepts in fewer lines of code. This language supports both structure and object oriented program design models.
Visual Basic: The programming language and environment developed by Microsoft. Based on the BASIC language, Visual Basic was one of the first products to provide a graphical programming environment and a paint metaphor for developing user interfaces. Instead of worrying about syntax details, the Visual Basic programmer can add a substantial amount of code simply by dragging and dropping controls, such as buttons and dialog boxes, and then defining their appearance and behavior.
ALGOL: ALGOL is short for algorithmic language. It is a family of portable programming languages for scientific computations that had a strong influence on other languages. Additionally, ALGOL was used as the standard method for creating algorithms by the ACM in textbooks and academia for over 30 years.
Fortran: Fortran, as derived from Formula Translating System, is a general-purpose, imperative programming language. It is used for numeric and scientific computing. Fortran was originally developed by IBM in the 1950s for scientific and engineering applications.
Oracle: Oracle database (Oracle DB) is a relational database management system (RDBMS) from the Oracle Corporation. Originally developed in 1977 by Lawrence Ellison and other developers, Oracle DB is one of the most trusted and widely-used relational database engines.
Mid-Level Language: The languages having characteristics of both low level languages and high level languages is called mid level language. Using mid level language it can be done bit-level programming or hardware can be controlled with system software and it is also characteristics of low-level languages. On the other hand, application softwares can be developed using mid-level languages and it is also characteristics of high-level languages. Some examples of mid level languages are- C, Forth, Dbase, WordStar etc.
Fourth Generation Language(4GL): 4GL stands for Fourth Generation Language. Fourth Generation Language is also called very high level programming language.Fourth generation programming languages are the one which are closer to human languages rather than the high level or middle level programming languages. 4GLs are associated with databases and data processing, allowing the efficient development of business-oriented systems. Most fourth-generation languages are non-procedural or functional languages that encourage users and programmers to specify the results they want, while the computer determines the sequence of instructions that will accomplish those results. Thus, fourth-generation languages have helped simplify the programming process. Examples of 4GLs are SQL, Oracle etc.
Fifth Generation Language(5GL): 5GL stands for Fifth Generation Language. Fifth Generation Language is also called natural language. Fifth generation languages are designed to make the computer solve a given problem without the programmer. Fifth-generation languages are used mainly in research and to manufacture artificial intelligence(AI) based devices or machines. Intelligent Compiler is used to translate the program written in 5GL to machine language. Examples of 5GLs PROLOG(PROgramming LOGic), LISP, Mercury etc.
Knowledge Based Questions:
- a. What is program?
- a. What is programming language?
- a. What is programming?
- a. What is programmer?
- a. What is machine language?
- a. What is assembly language?
- a. What is mnemonic?
- a. What is low level language?
- a. What is high level language?
- a. What is 4GL?
Comprehension Based Questions:
- b. Explain the language written with 0,1.
- b. It is possible to express language using only numbers without words-explain.
- b. “The limitation of Low level programming language is the reason of creating high level programming language”-explain.
- b. Why the program written in machine language is executed fast?
- b. Why assembly language is more developed than machine language?
- b. High level programming language is better than machine language-explain.
- b. It is easy to program in high level programming language-explain.
- b. Why C programming language is called mid-level programming language?
- b. C is one kind of high level programming language-explain.
Read the stem and answer the questions:
Nafica madam was discussing programming language in ICT class. She said, program had been written using only numbers before. But at present that is not used. She further said, Now a days C programming language is very popular. She discussed about C programming language in details and told the students to write a program in C language for determining LCM of two numbers.
- c. Write details about the programming language mentioned first in the stem.
Read the stem and answer the questions:
Rahim and Karim are two programmers. The process of writing program of them are different. Rahim uses different symbols for writing program. On the other hand, Karim uses different English words for writing program.
- c. Which type of language is used by Rahim in the stem?-Explain.
- d. Which one is more convenient programming languages mentioned in the stem? Analyze.
Read the stem and answer the questions:
Nipa and Orpa are two friends. They are learning various programming languages. Nipa wrote a program using such a programming language that the program can not be used in other computers and the program need not to be translated. On the other hand the program written by Orpa can be used in all types of computers and to wrote a program using such language no need to know the internal hardware configuration.
- c. The programming language used by Nipa is in which generation? explain.
- d. Which level of programming languages is more convenient as mentioned in the stem? Analyze.
Multiple Choice Questions: