STRUCTURED PROGRAMMING
HISTORY OF COMPUTER PROGRAMMING
LEVELS OF PROGRAMMING LANGUAGES
Many programming languages have been developed over the years. These languages can be
divided into two major levels:
1. Low level languages
These are languages that are directly understood by the computer or may need very little effort to
convert into machine readable form.
Lowe level languages are first and second generation languages.
Examples of low level languages are Machine langusge and Assemply language
Advantages And Disadvantages Of Machine Language
Advantages
A computer can easily understand the low level language.
They are stable and hardly crash once written
Low level language instructions are executed directly without any translation.
Low level language instructions require very less time for thier execution.
Disadvantages
machine language instructions are very difficult to use and understand.
machine language instructions are machine dependent, that means a program written for a
particular machine does not executes on other machine.
In machine language, there is more chance for errors and it is very difficult to find errors,
debug and modify.
Advantages And Disadvantages Of Assembly Language
Advantages
Writing instructions in Assembly language is easier than writing instructions in machine
language.
Assembly language is more readable compared to low level language.
Easy to understand, find errors and modify.
Disadvantages
Assembly level language is specific to a particular machine architecture, that means it is
machine dependent.
Assembly level language needs to be translated into machine language.
Assembly level language executes slower compared to machine language.
2. High level languages
These are languages that are very close to human language (English –like). High level languages
have to be converted into machine readable form by a translator.
High level languages are third generation to fifth generation languages.
Advantages And Disadvantages Of High level Language
Advantages
Writing instructions in high level language is more easier.
High level language is more readable and understandable.
The programs created using high level language runs on different machines with little
change or no change.
Easy to understand, create programs, find errors and modify.
Disadvantages
High level language needs to be translated to machine language.
High level language executes slower compared to low level languages.
GENERATIONS OF PROGRAMMING LANGUAGE
FIRST GENERATION OF PROGRAMMING LANGUAGE
The first generation of programming language, or 1GL, is machine language. Machine language
is a set of instructions and data that a computer's central processing unit can execute directly.
Machine language statements are written in binary code, and each statement corresponds to one
machine action.
SECOND GENERATION PROGRAMMING LANGUAGE
The second generation programming language, or 2GL, is assembly language. Assembly
language is the human-readable notation for the machine language used to control specific
computer operations. In assembly language instructions are written using symbolic instruction
codes that are meaningful abbreviations called mnemonics. Assembly instructions are translated
into machine language using assembler.
THIRD GENERATION PROGRAMMING LANGUAGE
The third generation of programming languages, 3GL, or procedural language uses a series of
English-like words, that are closer to human language, to write instructions. High-level
programming languages make complex programs simpler and easier to read, write and maintain.
Programs written in a high-level programming language must be translated into machine
language by a compiler or interpreter.
Examples are PASCAL, FORTRAN, BASIC, COBOL, C, Ada.
Objectives of high-level languages
To relieve the programmer of the detailed and tedious task of writing programs in machine
language and assembly languages.
To provide programs that can be used on more than one type of machine with very few
changes.
To allow the programmer more time to focus on understanding the user’s needs and
designing the software required meeting those needs.
FOURTH GENERATION PROGRAMMING LANGUAGE
Fourth generation languages also known as very high level languages are non-procedural
languages, so named because they allow programmers and users to specify what the computer is
supposed to do without having to specify how the computer is supposed to do it. Because they
are so much easier to use than third generation languages, fourth generation languages allow
users, or non-computer professionals, to develop software. Fourth generation languages are
commonly used in database programming and scripts examples include Perl, PHP, Python, Ruby,
and SQL.
Objectives of fourth generation languages
Increasing the speed of developing programs.
Minimizing user effort to obtain information from computer.
Decreasing the skill level required of users so that they can concentrate on the application
rather than the intricacies of coding, and thus solve their own problems without the aid of a
professional programmer.
Minimizing maintenance by reducing errors and making programs that are easy to change.
Components of fourth generation languages
Query languages
Query languages allow the user to ask questions about, or retrieve information from database
files by forming requests in normal human language statements (such as English).
Report generators.
Report generators are similar to query languages in that they allow users to ask questions from a
database and retrieve information from it for a report (the output); however, in case of a report
generator, the user is unable to alter the contents of the database file.
Applications generators.
Application generators allow the user to reduce the time it takes to design an entire software
application. The user is only required to key into computer the specification for what the
program is supposed to do. The resulting information is input to the applications generator,
which determine how to perform the tasks and which then produces the necessary instructions
for the software program.
FIFTH GENERATION PROGRAMMING LANGUAGE
The fifth generation programming language or visual programming language, is also known as
natural language. They provides a visual or graphical interface, called a visual programming
environment, for creating source codes. Fifth generation programming allows people to interact
with computers without needing any specialized knowledge. People can talk to computers and
the voice recognition systems can convert spoken sounds into written words.
Examples: Prolog, Mercury, Occam, Lisp etc.
PROGRAMMING PARADIGMS
A programming paradigm is a style, or “way,” of programming.
Structured/procedural programming
This is a programming style where by the programmer gives a step-by-step specification of how
to solve the problem. The program has a definite start and a definite end. Each step is defined
using a piece of code known as procedure or function.
Structured programming imposes a logical structure to the coding of a program in order to make
it easy to follow, modify and debug. Large routines are broken down into small modules that
have to be methodically and carefully nested within each other, because the use of the GOTO
statement is either discouraged or not available in the language.
Examples of structured programming languages
- Pascal
- C
- Fortran
- Cobol
- Others
Unstructured programming
In unstructured programming, the program must be written as a single
continuous block of code.
Internet based programming
Web programming refers to the writing, markup and coding involved in Web development,
which includes Web content, Web client and server scripting and network security. The most
common languages used for Web programming are XML, HTML, JavaScript, Perl 5 and PHP.
A web application is a client-server application that uses standard Internet protocols for
connecting the client to the server. A web application is one which runs on your corporate
intranet, and is only available to the staff in your corporation. Whenever we talk about web
applications, we mean either true Internet applications or intranet applications.
Modular Programming approach
This approach helped in dividing programs into small parts called modules. Then various
modules can then be intergrated together to make a complete program.
Object oriented programming
This is a programming technique that uses the concept of class to combine data and operations
that can be identified with objects of their type. A class is a concept used to group related things
together by specifying the characteristics of each including the type of data (or properties) that
can be stored for each object, as well as the operations that can be performed on each.
Examples of object oriented programming languages
- C++
- Java
- C#
Visual programming
Visual programming is a programming technique that uses graphical elements and figures to
develop a program.
VP Language employs techniques to design a software program in two or more dimensions, and
includes graphical elements, text, symbols and icons within its programming context.
Visual programming language enables the development of software programs by eliminating
textual software code with a series of visual graphics elements.
Examples of visual programming languages
Visual Basic, Visual C++, Delphi, etc.
Program development
Is the comprehensive process that leads to executable program. It involves activities such as analysis,
understanding, and generically solving such problems resulting in an algorithm, verification of
requirements of the algorithm including its correctness and its resource consumption, implementation or
coding of the algorithm in a target programming language, testing, debugging, and maintaining the source
code, implementation of the build system and management of derived artifacts such as machine code of
computer programs.
Program Development Life Cycle
When we want to develop a program using any programming language, we follow a sequence of
steps. These steps are called phases in program development. The program development life
cycle is a set of steps or phases that are used to develop a program in any programming
language.
Generally, program development life cycle contains 6 phases, they are as follows:
Problem Definition
Problem Analysis
Algorithm Development
Coding & Documentation
Testing & Debugging
Maintenance
1. Problem Definition
In this phase, we define the problem statement and we decide the boundaries of the problem. In
this phase we need to understand the problem statement, what is our requirement, what should be
the output of the problem solution? These are defined in this first phase of the program
development life cycle.
2. Problem Analysis
In phase 2, we determine the requirements like variables, functions, etc. to solve the problem.
That means we gather the required resources to solve the problem defined in the problem
definition phase. We also determine the bounds of the solution.
3. Algorithm Development
During this phase, we develop a step by step procedure to solve the problem using the
specification given in the previous phase. This phase is very important for program development.
That means we write the solution in step by step statements.
4. Coding & Documentation
This phase uses a programming language to write or implement actual programming instructions
for the steps defined in the previous phase. In this phase, we construct actual program. That
means we write the program to solve the given problem using programming languages like C,
C++, Java etc.,
5. Testing & Debugging
During this phase, we check whether the code written in previous step is solving the specified
problem or not. That means we test the program whether it is solving the problem for various
input data values or not. We also test that whether it is providing the desired output or not.
6. Maintenance
During this phase, the program is actively used by the users. If any enhancements found in this
phase, all the phases are to be repeated again to make the enhancements. That means in this
phase, the solution (program) is used by the end user. If the user encounters any problem or
wants any enhancement, then we need to repeat all the phases from the starting, so that the
encountered problem is solved or enhancement is added.