Concept of Programming Language and its types- Programming language is the computer language which is used to design and write the computer programs. As the real world intense what language we used to speak for communication in the same way a language which is designed to communicate with the computers to design and code a program can be treated as programming language.
It is a sequence of instructions in which the problems of computer tasks and steps are performed with the help of computer. A person who writes or performs the program is known as programmer. Programmer uses some specific languages to write program which is known as programming languages e.g. C++, Java, etc.
It is a set of keywords, symbols and a system of rules for constructing statements by which human can communicate instructions to be executed by a computer.
Types of Computer Language
Computer languages can be classified into three board categories :
- Low Level Language
- Medium Level Language
- High Level Language
Low Level Language
This programming languages are most arcane and difficult to understand. It is designed to operate and handle the entire instruction set of a computer system directly which are generally used to write the system software e.g. Machine Language and Assembly Language.
Machine language is a collection of binary digit (0,1) or bits that the computer reads and interprets. Machine language is the only language a computer is capable of understanding. Each instruction in a program is represented by a numeric code, and numerical addresses are used throughout the program to refer to memory locations in the computer’s memory. A Machine level language no more needs any mediator to convert the code so that can be sent for execution.
- It makes fast and efficient use of the computer.
- It requires no translater to translate the code i.e. directly understood by the computer.
- Binary code is virtually unreadable.
- Machine language programs are hard to maintain and debug.
It is a low level programming language which is used as an interface with computer hardwares. In Assembly language programs can easily be written in alphanumeric symbols instead of 0’s and 1’s. Meaningful and easily rememberable symbols are selected for this purpose. For example, ADD for addition, SUB for subtraction, CMP for comparison, etc. such symbols are known as mnemonics. To convert Assembly language written program into machine language Assembler is used so that it can be sent for execution.
It is a little faster than Machine language, variables are directly declared in registers.
Difficult to implement. Difficult to remember Mnemonics while implementation. Time consuming. 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.
Medium Level Language
It serves as a bridge between raw hardware and programming layer of a computer system. It is designed to improve the translated code before it is executed by the processor. C language is known as medium level language.
High Level Language
High level language means general English language which is very near to human understanding. It is an advanced computer programming language that is not limited to one computer, designed for a specific job and is easier to understand. Using high level programming language, we can easily and accurately write program codes and reduce the mistakes.
High level language uses ‘Compilers’ and ‘Interpreters’ to convert the program code into binary information so that it can be sent for execution. Examples of high level languages are BASIC, FORTRAN, C, C++, Java, C#, Python, Visual Basic, Delphi, Perl, Rubby, PHP and many more.
The main advantages of high level languages over low level languages is that they are easier to read, write and understand.
- Easy to understand and implement because of high level language (English) is used.
- Faster in comparison to Machine level and Assembly level language.
- Less time consuming, probability of error is less.
- It takes additional translation times to translate the source to machine code.
- High level programs are comparatively slower than low level programs.
- Cannot communicate directly with the hardware.
|FORTRAN (Formula Translator)||1957||A team of programmers at IBM||Calculation||Compiled|
|ALGOL (Algorithmic Language)||1958||A committee of European and American computer scientist||Scientific purpose||Compiled|
|LISP (List Processing)||1958||John McCarthy at the Massachusetts Institute of Technology (MIT)||Artificial intelligence||Compiled and Interpretedr|
|COBOL (Common Business Oriented Language)||1959||Grace Hopper||Business management, string oriented||Compiled|
|BASIC (Beginner’s All purpose Symbolic Instruction Code)||1964||John G. Kemeny and Thomas E. Kurtz at Dartmouth college in New Hampshire||Programming for educational purpose||Interpreted|
|C||1972||Dennis Ritchie at Bell Labs||System programming||Compiled|
|C++||1983||Bjarne Stroustrup at Bell Labs||System object programming||Compiled|
|Java||1995||James Gosling at Sun Microsystems||Internet oriented programming||Compiled and Interpreted|
The language in which a programmer writes program by using text editor or other programming tool and then save file is called source language. It may be a high level language or an assembly language. The language in which the computer works is called object language or machine language. Machine codes are also known as object code. A program written in a source language is called a source program. When a source program is converted into machine code by assembler or compiler, it is known as an object program which can be understood directly by a specific type of CPU.
Language translator helps in converting programming languages to machine language. Language translator are divided into three categories which are as follows :
It converts a program written in assembly language into machine language. Assembly language consists of Mnemonic codes, which are difficult to learn and are machine dependent.
Some basic functions of an assembler are as follows :
- Replaces mnemonic codes by machine codes.
- Replaces symbolic addresses by numeric addresses.
- Determine machine representation for constants.
Assembler needs to –
- Translate assembly instructions and pseudo instructions into machine instructions.
- Convert decimal numbers etc. specified by programmer into binary.
Typically assemblers make two passes over the assembly file :
- First pass: Reads each line and records labels in a symbol table.
- Second pass: Use info in symbol table to produce actual machine code for each line.
Interpreter is another kind of program translator which is used to convert the high level language into machine level language by converting it line by line. If there is any error in any line, it stops the execution of the program immediately and reports the user at the same time and program execution cannot resume until the error is rectified by the user. Interpreter is very useful for debugging and suitable for novice programmer. This is a slow process and consumes less memory. Interpreter is used in mostly fourth generation languages (4GL) like Visual basic, Web driven applications etc.
- Relatively little time is spend analyzing and processing the program.
- The resulting code is some sort of intermediate code.
- The resulting code is interpreted by another program.
- Program execution is relatively slow.
The name “compiler” is primarily used for programs that translate source code from a high level programming language to a lower level language which can be understood by the processor. For each high level language, the machine requires a separate compiler. If the compiled program can only run on a computer whose CPU or operating system is different from the one on which the compiler runs, the compiler is known as a cross-compiler. A program that translates from a low level language to a higher level one is a de-compiler.
The compiler has another task apart from translating your program. It also checks it to make sure that it is grammatically correct. Only when it is sure that there are no grammatical errors does it do the translation. Any errors that the compiler detects are called compile-time errors or syntax error. If it find so much as one syntax error, it stops compiling and reports the error to you.
- Spends a lot of time analyzing and processing the program.
- The resulting executable is some form of machine specific binary code.
- The computer hardware interprets the resulting code.
- Program execution is fast.
To write a logical step by step method to solve the problem is called algorithm, or in other words, you can say that an algorithm is a procedure for solving problem. It can be presented by natural languages, pseudo code and flowcharts etc.
The desirable features of an algorithm are:
- Each step of algorithm should be simple.
- It must be and in a finite number of steps.
- It should be as efficient as possible.
- It should be unambiguous in the sense that the logic should be crisp and clear.
- It should be effective, i.e. it must lead to a unique solution of the problem.
A flowchart is a graphical or symbolic representation of a process. Each step in the process is represented by a difference symbol and contains a short description of the process step. The flowchart symbols are linked together with arrows showing the process flow direction. Flowchart are used in analysing, designing, documenting or managing a process or program in various field.
The two most common types of boxes in a flowchart are:
- A processing step usually called activity and denoted as a rectangular box.
- A decision usually denoted as a diamond.
Types of Flowchart Symbols
|Terminal or Oval||It is used as the beginning and end of the algorithm to show start and end of the program.|
|Input/ Output||It is used to take input by the user in the variable declared and display the value of a variable in the program.|
|Processing||It is used to demonstrate the processing of the program. In a program whatever numerical operations get place is displayed in the rectangular box in a flowchart program.|
|Decision Box||It is in the diamond shape which is used to place a condition in the program. Line coming out from the diamond indicates different possible situations, leading to different sub processes.|
|Flow Lines||This is the shape in the flowchart used to indicate the control flow of the program. It is displayed using an arrow sign.|
|Entry connector||An Entry in the flowchart is made at the connecting point marked.|
|Connector||It is the another shape of flowchart what is used to concatenate the flow of the program from one page to another following with a notation containing an alias and at the second page using another connector using the same notation with same alias to continue the program flow.|
Rules for Creating a Flowchart
There are some rules for making a flowchart, by using which we can easily create a flowchart. These are as follows:
- Firstly we think about the main logic of the programm or algorithm then think about what symbols are used for defining the logic of the program.
- All flowcharts have a starting point and ending point.
- The flowchart should be read left to right or top to bottom.
- All the statements used in the flowchart symbols should be precise and easy to understand.
- All the symbols are connected with arrow to represents in which direction the flowchart is going on.
- When we use some condition in the flowchart, it has two exit points. The top side, the bottom side or the side side, which has two outputs, first true and the second false.
- For a decision symbol, only one flow line can enter it, but multiple lines can connected with to denote possible answers.
- A process symbol can have only one flow line coming out of it.
- The flow of control must not split. You can use Decision objects to give the flow of control a choice of paths to follow, but it can only follow one of these paths.
- The terminal symbols can only have one flow line.
Difference between Algorithm and Flowchart
|It is a procedure for solving problems.||It is a graphic representation of a process.|
|The process is shown in step-by-step instruction.||The process is shown in block-by-block information diagram.|
|It is complex and difficult to understand.||It is intuitive and easy to understand.|
|It is convenient to debug errors.||It is hard to debug errors.|
|The solution is displayed in natural language.||The solution is displayed in pictorial format.|
|It is easy to solve complex problem.||It is hard to solve complex problem.|