You are on page 1of 14

Certificate - Software Development

Algorithms & Evolution of Programming

1
What is an Algorithm ?

▪ When we want to design and implement a


program it is important to develop a “blueprint”
of the program, which details the step by step
procedure in arriving at the solution. Such a
“blueprint” is called an algorithm.

▪ This is just similar to creating an architectural


plan for a house which we are planning to
build.

2
Good Algorithm - Characteristics
▪ It must be concise – We must be able to describe the solution to a problem
without writing multiple pages of text.

▪ It must be unambiguous – The description of the procedure must not be


open to alternative interpretations.

▪ It must be capable of machine execution – The actions described must


be capable of translation into precise, machine-executable operations.

▪ It must promote elegance in the solution – The tool must prevent the
programmer from using practices at the design stage which lead to poor
programming style during implementation.

3
Tools for Algorithm Design

As natural languages do not bear the qualities mentioned


above, following “Semi Formal Specifications” are used
for developing algorithms. These are called Program
Design Tools.

▪ Flow charts
▪ Structure Chars
▪ Pseudocode

4
Evolution of Program Design
There is perhaps a tendency to think that software design was
always as it is now. This is not so, and a brief look at its
development may help to shed some light on the reasons why
current practices and development tools are promoted as desirable.

Following are Key Stages of Software Design Evolution


▪ Unstructured Design / Programming
▪ Structured Design / Programming
▪ Modular Design / Programming
▪ Object Oriented Design / Programming

5
Unstructured Programming

▪ When programming emerged as an


activity some sixty years ago, the main
preoccupation was with the correctness of
the solution.
▪ Precisely how that solution was derived
was very much subordinate to the actual
solution itself.
▪ Programming was considered much like
an art and no standards or best practices
were in place.

6
Unstructured Programming Ctd.

▪ Main tool used was Flow Chart and it


allowed the use of many GOTOs
(Unconditional Branch) in the program.
▪ These GOTOs allowed the control to
pass from one place to another without
having any restrictions.
▪ This resulted in complex code that were
difficult to understand and maintain.
Such code was called “Spaghetti Code”

7
Structured Programming

▪ Structured programming was developed


during early 1970s after Edger Dijkstra's
insightful comments into the harmful
nature of the GOTO statement.
▪ Dijkstra and others subsequently created
a set of acceptable structures in
programming that would enable
development without GOTO statements.

8
Structured Programming Ctd.

▪ The structured programming uses three control


constructs namely:

▪ Sequence
▪ Selection
▪ Repetition

▪ These structures produced programs that were


easier to read by humans easier to debug and
easier to test.

9
Modular Programming

▪ This further enhanced concepts of


structured programming
▪ Modular programming is a software
design technique that emphasizes
separating the functionality of a program
into independent, interchangeable
modules
▪ Each modules contains everything
necessary to execute only one aspect of
the desired functionality
10
Modular Programming Ctd.

Advantages of Modular Programming


▪ Changing a Complex program in less complex smaller
pieces.
▪ More understandable program
▪ Easier modification and maintenance of the program
▪ Code Reusing
▪ Function can be called from anywhere with different input data
▪ Function enables the programmer to generate their own libraries
of functions.

11
Object Oriented Programming

▪ Object oriented programming (OOP)


is the major programming paradigm
used now.
▪ Much of this approach is owed to
concepts which also gave rise to
structured programming and modular
programming.
▪ It has further enhanced the good
practices enforced by it’s
predecessors and generalized them.

12
Object Oriented Programming Ctd.

▪ An object is a particular instance of a class


and consists, essentially, of data which
defines its characteristics and status together
with procedures, or ‘methods’, which operate
on the object.
▪ For example, an object may be a bank
account possessing data items which record
the name and address of its owner and its
current balance. It may have associated
methods which allow its creation, deletion
and amendment with deposits and
withdrawals.
13
Lesson Summary

▪ What is an Algorithm
▪ Good algorithm – Characteristics
▪ Tools for algorithm design
▪ Unstructured programming
▪ Structured programing
▪ Modular programming
▪ Object oriented programming

14

You might also like