Introduction to Programming :
Program :
A program is a set of instructions which are grouped together to perform a particular task.
Programming :
Programming is instructing a computer to do some task with the help of a programming language.
Programming Language :
A programming language is used to write programs. They are defined by syntactic and semantic rules which describe their structure. For example C, C++, JAVA. Normally programming languages refers to high level programming languages.
Paradigms of programming languages :
The Paradigms of programming Language gives the model to the programmer to write the programs.The different Paradigms of programming languages are
- Unstructed Programming (or) Monolithic Programming
- Procedural Programming
- Structural Programming
- Object Oriented Programming
Monolithic Programming :
- In this whole problem is solved as a single block.
- All the data are global and there is no security.
- To share the codes jumps are allowed and so contain lot of go to statements.
- This is suitable only for small problem.
- Difficult to follow and correct errors
Eg, Assembly Language, BASIC.
Procedural Programming :
- The given problem is divided in to a number of sub problems depending upon its functionality.
- The sub problems are called procedures or Methods.
- Any procedure can be called at any point during the program execution.
- The program has global and local variables.
- Global variables can be only be used
Features of procedure oriented Programming :
- Large Programs are divided in to small function or Procedure.
- Uses Top-Down programming Approach.
- Data moves freely from one function to another.
- Most of the functions share common data.
- Emphasis is given for algorithms.
Disadvantages :
- Very difficult identify which data is used by which function.
- Error Correction is difficult.
Structural Programming :
- The program is divided into modules and the modules are then divided into functions.
- The usage of goto statement is removed or reduced.
- Each module can work independent of one another.
Example: ADA, C++.
Object Oriented Programming :
- The Program is divided into number of small units called Object. The data and function are build around these objects.
- The data of the objects can be accessed only by the functions associated with that object.
- The functions of one object can access the functions of other object.
No comments:
Post a Comment