What is Programming Languages ?
what programming languages did bill gates develop? |
A set of words and symbols used to write programs is called programming language It is a means of communication between a user and the computer. The programming languages are used to write computer programs. A programming language defines the rules for writing the computer programs. A large number of programming languages are available for writing programs. The programmer selects a programming language according to the type of the program. There are two types of computer programming languages.
- Low-level languages
- High-level languages
Who is a programmer?
A person who develops a program is called programmer. The programmer develops programs to instruct the computer how to process data to convert into information. Programmer uses programming languages or tools to write programs.
What is the use of programming languages?
A set of words, symbols and cold for writing different types called program language. Different programming languages are available from other de dewed for writing programs. Some language afferent perorally used for writing business programs, other are used for writing scientific programs Nagy.
Who is a programmer?
A person who develops a program is called programmer. The programmer develops programs to instruct the computer how to process data to convert into information. Programmer uses programming languages or tools to write programs.
What is the use of programming languages?
A set of words, symbols and cold for writing different types called program language. Different programming languages are available from other de dewed for writing programs. Some language afferent perorally used for writing business programs, other are used for writing scientific programs Nagy.
What is Low Level Languages ?
A language that is close to hardware and far from human language is called low level language. These languages are difficult to use and require deep knowledge of computer hardware. Two types of low-level languages are machine language and assembly language.
What is
Machine Language ?
A type of language in which the instructions are written in binary form is called machine language. It is the only language that is directly understood by the computer. A program written in machine language can be executed very fast by the computer.
The programs written in machine language are machine-dependent. Every computer has its own machine language. A program written for one type of computer system cannot run on another type of computer system. Machine language is difficult to understand and learn. The process of writing and modifying program in machine language takes a lot of time.
List any three advantages of assembly language over machine language.
The assembly language is easier to understand and use as compared to machine language. It is easier to locate and correct errors . The program written in assembly language are easier to modify.List some disadvantages of machine language?
Different disadvantages of machine language are as follows
Machine Dependent
Machine language is machine-dependent. Each type of hardware requires its own machine language.
Difficult
Machine language is difficult to understand.
Time-Consuming
Writing programs in machine language takes a lot of time.
List some advantages of machine language?
Different advantages of machine language are as follows:Fast Execution
Instruction written in machine language run faster.No Translator Required
Machine language program is directly understood by the computer and is not required to convert.
What is Assembly Language
Assembly language is a low-level language. It is one step higher than machine language. The assembly language uses English-like words instead of machine instructions These words are known as mnemonics and pronounced as Ne-Monics.
The programs in assembly language are easier to write and modify than machine language. Assembly language is mostly used for writing system software. The programs written in assembly language cannot be executed by the computer directly
Why assembly language is called symbolic language?
Assembly language is called symbolic language because it uses symbols called mnemonics. For example Sub instruction is used to subtract two numbers.
Define High Level Languages ?
A type of language that is close to human languages is called high-level language The instructions in these languages are similar to English language such as input and print etc. A program in high-level language is easier to write and modify.
High-level languages are further divided into following categories:
- Procedural Languages
- Object-Oriented Languages
- Non-Procedural Languages
What is Procedural Languages ?
Procedural languages are also known as third-generation languages or 3GL. In these languages, program is a predefined set of instructions. Computer executes these instructions in the same sequence in which they are written. Each instruction in this language tells the computer what to do and how to do.
Some most popular procedural languages are as follows:
1. FORTRAN
FORTRAN stands for FORmula TRANslation. It was mainly used to develop scientific and engineering applications.
2. BASIC
BASIC stands for Beginner All Purpose Symbolic Instruction Code. It was created in the late 1960s. It was mainly used by the students for solving simple problems. It is easy to understand. It is widely used for education purpose
3. COBOL
COBOL stands for Common Business Oriented Language. It was specially designed for business applications. It was developed in early 1960s. The programs written in COBOL are lengthy but easy to read, write and maintain.
4. PASCAL
Pascal is used for both scientific and business applications. Its name was assigned in the honor of a French mathematician Pascal.
5. C Language
C language is a popular high-level language. It was developed by Dennis Ritchie at AT&T Bell Laboratories in 1972. It was written as part of UNIX operating system. It is also known as middle-level language as it can be used to write application software as well as system software.
Different between Low-Level Language and High-Leve Language
The difference between Low-Level Language and High-Leve Language is as follows:
High-Level Languages |
Low-Level Languages |
High-level
languages are easy to learn. |
Low-level
languages are difficult to learn. |
High-level
languages are near to human languages |
Low-level
languages are far from human languages. |
Programs in
high-level languages are slow in execution. |
Programs in
low-level languages are fast in execution. |
Programs in
high-level languages are easy to modify. |
Programs in
low-level languages are difficult to modify. |
High-level
languages do not provide much facility at hardware level. |
Low-level
languages provide facility to write programs at hardware level. |
Deep
knowledge of hardware is not required to write programs. |
Deep
knowledge of hardware is required to write programs. |
These
languages are normally used to write application programs. |
These languages are normally used to write hardware programs. |
What are major types of programming languages? Give examples:
Two major types of programming languages are low-level and high-level languages:
Low Level Languages
These languages are near to computer hardware and far from human languages. Computer can understand these languages easily. Writ Writing a program in low-level languages requires a deep knowledge pies of low-level programming imputer hardware. Machine language and assembly language are examples languages
High Level Languages
A type of language that is close to human languages is called high level language. High-level languages are easy to understand Instructions of these languages are written in English-like words such as input and print etc. C++, Java and Visual Basic are examples of high-level programming languages.
Natural Programming Languages
Natural programming languages are also known as fifth generation languages (5GL) or intelligent languages. The translator programs for these languages are very complex and require a large amount of f computer resources. That is why most of these languages are still in experimental phase.
Types of Codes
Two types of codes are as follows.
1.Source Code
A program written in a high-level language is called source code Source code is also called source program. Computer cannot understand the statements of high-level language. The source code cannot be executed by computer directly. It must be converted into object code and then executed.
2. Object Code
A program in machine language is called object code It is also called object program or machine code. Computer understands object code directly.
Difference between Source Code and Object Code
The difference between source code and object code is as follows:
Source code |
Object Code |
Source code
is written in high-level or assembly language. |
Object code
is written in machine language through compilers |
Source code
is easy to understand. |
Object code
is difficult to understand. |
Source code
is easy to modify. |
Object code
is difficult to modify. |
Source code
contains fewer statements than object code. |
Object code
contains more statements than source code. |
Language Processor
Computer understands only machine language. A program written in high-level or assembly language cannot be executed on a computer directly. It must be converted into machine language before execution. Language processor is a software that converts these programs into machine language Every computer language has its own translators.
Different types of language processors are as follows:
Compiler
A compiler is a program that converts the instructions of a high level language into machine language as a whole. A program written in high-level language is called source program. Compiler converts source program into machine code known as object program. The compiler checks each statement in the source program and generates machine instructions. Compiler also checks syntax errors in the program. A source program containing a syntax error cannot be compiled.
A compiler can translate the programs of only that language for which it is written. For example, C compiler can translate only those programs that are written in C language.
Interpreter
An interpreter is a program that translates one instruction of the program at a time. It converts the instruction into machine language and executes It then moves to the next instruction of the program. It displays the error message if there is an error in the instruction The advantage of interpreter over compiler is that the error is found immediately The programmer can correct the errors during program development. The disadvantage of interpreter is that it is not very efficient. The interpreter does not produce an object program It converts the instructions into machine language each time the program is executed BASIC language uses interpreter
Assembler
An assembler is a program that translates the instructions of assembly language program into machine language.
Difference between Compiler and Interpreter
The difference between compiler and interpreter is as follows:
Compiler |
Interpreter |
Compiler
converts a program into machine code as a whole. |
Interpreter
converts a program into machine code statement by statement. |
Compiler
creates object code file. |
Interpreter
does not create object code file. |
Compiler
converts high-level program that can be executed many times |
Interpreter
converts high-level program each time it is executed. |
Program
execution is fast. |
Program
execution is slow. |
Compiler
displays syntax errors after compiling the whole program. |
Interpreter
displays the syntax error on each statement of program. |
Relationship of Object Program, Source Program and Compiler
A source program is written by a programmer in a programming language such as C. This program is not in a form that a computer can understand. A compiler translates that source program into the object program that the computer can understand and execute.
Programming Techniques
Computer programs are developed by using different programming techniques. Some important programming techniques are as follows
Structured Programming
Structured programming is a programming technique in which a program is divided into small units called modules or subprogram. Each module consists of different instructions to perform a specific task. A module is executed when the main program calls it.
When main program calls a module, the control moves to the called module temporarily. The control moves back to the main program after executing the instructions of the module Structured programming is an easy and simple technique for writing programs.
It makes programs easier to write, check read and modify. This technique uses only three type of instructions so the programs are not very complex Structured programming uses the following types of instructions
Sequential Structure
The sequential structure executes the statements in the same order in which they are written in the program. The statements are executed one after the other. All statements of the program are executed. It means that no statement is skipped and no statement is executed more than once.
Conditional Structure
The conditional structure executes a statement or set of statements based on a condition. It executes a statement if the given condition is true and ignores when the condition is false. It is also called decision-making structure or selection structure
Suppose a program displays Pass if the student gets 40 or more than 40 marks. It displays Fail when the marks are below 40 The program checks the marks before displaying the message. This process is known as decision-making or selection
Iterative Structure
The iteration structure executes a statement or set of statements repeatedly for a specific number of times. It is also called repetition structure or loop For example, a program can use iteration structure to display a message on the screen for ten times.
Advantages of Structured Programming
Some advantages of structured programming are as follows:
1. Reusability
Structured programming allows the user to reuse the existing code as and when required A frequently used code can be written in a block with a specific name. This block of code can be executed again and again without writing the same code again.
2. Easier to Code
It is easier to write small blocks of code instead of writing a long program as a whole. It allows the user to focus on a specific problem in a particular block.
3. Easier to Modify
Each block of code has a unique name and is written separately from other code. It is easier to modify than a long program.
4. Easier to Maintain
Small blocks are easier to maintain as compared to longer programs. Each block is independent so any change in it does not affect other blocks.
Disadvantage of Structured Programming
In structured programming, data cannot be considered as independent from functions that manipulate it. Procedural programming prevents the programmer from separating data from functions.
0 Comments