0% found this document useful (0 votes)
7 views4 pages

Programming Paradigms

This unit covers software development paradigms, focusing on programming methods and challenges in software implementation. It categorizes programming languages into various paradigms such as imperative, functional, logic, and object-oriented, each with distinct characteristics and applications. The unit also discusses the importance of structured coding, modular programming, and the implications of different paradigms on software properties like scalability and reliability.

Uploaded by

p0979547655
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views4 pages

Programming Paradigms

This unit covers software development paradigms, focusing on programming methods and challenges in software implementation. It categorizes programming languages into various paradigms such as imperative, functional, logic, and object-oriented, each with distinct characteristics and applications. The unit also discusses the importance of structured coding, modular programming, and the implications of different paradigms on software properties like scalability and reliability.

Uploaded by

p0979547655
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

UNIT 19: SOFTWARE DEVELOPMENT PARADIGMS

UNIT OBJECTIVES
When you finish this unit, you will be able to:

§ Explain the main programming paradigms that are used in software development
§ Explain the challenges faced in software development

19.1 INTRODUCTION
Software development is the process of computer programming, documenting, testing, and bug
fixing involved in creating and maintaining applications and frameworks involved in a software
release life cycle and resulting in a software product. The term refers to a process of writing
and maintaining the source code, but in a broader sense of the term it includes all that is
involved between the conception of the desired software through to the final manifestation of the
software, ideally in a planned and structured process. Therefore, software development may
include research, new development, prototyping, modification, reuse, re-engineering,
maintenance, or any other activities that result in software products. In this lecture, we will study
about programming methods, documentation and challenges in software implementation.

19.2 PROGRAMMING PARADIGMS


The notion of programming paradigms is a way to classify programming languages according to
the style of computer programming. Features of various programming languages determine
which paradigms they belong to; as a result, some languages fall into only one paradigm, while
others fall into multiple paradigms. Some paradigms are concerned primarily with implications
for the execution model of the language, such as allowing side effects1 , or whether the
sequence of operations is defined by the execution model. Other paradigms are concerned
primarily with the way that code is organized, such as grouping code into units along with the
state that is modified by the code. Yet others are concerned primarily with the style of syntax
and grammar.

Common programming paradigms include imperative which allows side effects, functional
which does not allow side effects, declarative which does not state the order in which operations
execute, object-oriented which groups code together with the state the code modifies, procedural
which groups code into functions, logic which has a particular style of execution model coupled
to a particular style of syntax and grammar, and symbolic programming which has a particular

1
a function or expression is said to have a side effect if it modifies some state or has an observable interaction with
calling functions or the outside world.

200
style of syntax and grammar. The main programming paradigms2 are imperative (procedural)
paradigm, logic paradigm, functional paradigm and object-oriented paradigm. Generally, a
selected Programming Paradigm defines main property of a software developed by means of a
programming language supporting the paradigm.

• Scalability/ modifiability

• integrability/ reusability

• Portability

• Performance

• Reliability

• ease of creation

THE IMPERATIVE PARADIGM

The 'first do this, next do that' is a short phrase which really in a nutshell describes the spirit of
the imperative paradigm. The basic idea is the command, which has a measurable effect on the
program state. The phrase also reflects that the order to the commands is important. 'First do that,
then do this' would be different from 'first do this, then do that'.

Imperative programming states how the program shall be coded. Imperative programming uses
three main concepts:

§ Top-down analysis - A software is always made to perform some rational work. This rational
work is known as problem in the software parlance. Thus it is very important that we
understand how to solve the problem. Under top-down analysis, the problem is broken down
into small pieces where each one has some significance. Each problem is individually solved
and steps are clearly stated about how to solve the problem.

§ Modular Programming - While programming, the code is broken down into smaller group of
instructions. These groups are known as modules, subprograms or subroutines. Modular
programming based on the understanding of top-down analysis. It discourages jumps using

2
Note that there are a number of other programming paradigms. Check
[Link] for characteristics of all these paradigms

201
‘goto’ statements in the program, which often makes the program flow non-traceable. Jumps
are prohibited and modular format is encouraged in structured programming.

§ Structured Coding - In reference with top-down analysis, structured coding sub-divides the
modules into further smaller units of code in the order of their execution. Structured
programming uses control structure, which controls the flow of the program, whereas
structured coding uses control structure to organize its instructions in definable patterns.

Procedural programming is a sub-paradigm of imperative programming. It is based on the


concept of using procedures. Procedure (sometimes also called subprogram, routine or method)
is a sequence of commands to be executed. Any procedure can be called from any point within
the general program, including other procedures or even itself (resulting in a recursion).
Procedural programming is widely used in large-scale projects, when the following benefits are
important:

§ re-usability of pieces code designed as procedures (for example, as libraries);


§ ease of following the logic of program;
§ maintainability of code.

Programming languages that are based on the imperative paradigm include Fortran, Algol,
Pascal, Basic, C.

THE FUNCTIONAL PARADIGM

Functional programming is in many respects a simpler and more clean programming paradigm
than the imperative one. The reason is that the paradigm originates from a purely mathematical
discipline: the theory of functions. A function in mathematics should always produce the same
result on receiving the same argument. In procedural languages, the flow of the program runs
through procedures, i.e. the control of program is transferred to the called procedure. While
control flow is transferring from one procedure to another, the program changes its state.

In procedural programming, it is possible for a procedure to produce different results when it is


called with the same argument, as the program itself can be in different state while calling it.
This is a property as well as a drawback of procedural programming, in which the sequence or
timing of the procedure execution becomes important.

202
Functional programming provides means of computation as mathematical functions, which
produces results irrespective of program state. This makes it possible to predict the behavior of
the program.

Functional programming uses the following concepts:

• First class and High-order functions - These functions have capability to accept another
function as argument or they return other functions as results.

• Pure functions - These functions do not include destructive updates, that is, they do not
affect any I/O or memory and if they are not in use, they can easily be removed without
hampering the rest of the program.

• Recursion - Recursion is a programming technique where a function calls itself and repeats
the program code in it unless some pre-defined condition matches. Recursion is the way of
creating loops in functional programming.

• Strict evaluation - It is a method of evaluating the expression passed to a function as an


argument. Functional programming has two types of evaluation methods, strict (eager) or
non-strict (lazy). Strict evaluation always evaluates the expression before invoking the
function. Non-strict evaluation does not evaluate the expression unless it is needed.

• λ-calculus - Most functional programming languages use λ-calculus as their type systems.
λ-expressions are executed by evaluating them as they occur.

Common Lisp, Scala, Haskell, Erlang and F# are some examples of functional programming
languages.

THE LOGIC PARADIGM

The logic paradigm is dramatically different from the other three main programming paradigms.
The logic paradigm fits extremely well when applied in problem domains that deal with the
extraction of knowledge from basic facts and relations. The logical paradigm seems less natural
in the more general areas of computation. A program written in a logic programming language is
a set of sentences in logical form, expressing facts and rules about some problem domain.

203

You might also like