Understanding the Nuances of Programming Paradigms in Computer Science

Verified

Added on  2023/06/11

|5
|1102
|311
Essay
AI Summary
Document Page
Running head: PROGRAMMING PARADIGMS
1
PROGRAMMING PARADIGMS
Name of the Student:
Name of the Institution:
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
PROGRAMMING PARADIGMS 2
PROGRAMMING PARADIGMS
Programming languages developed over the years have distinct features, capabilities and
characteristics. Generally, the languages are classified according to the degree in which a user- a
developer or a programmer in this case, has freedom from control of ‘computer and its gibberish
world’, allowing them to critically and creatively think and design a better solution for the
problem at hand. The different paths that have been followed by different programmers and
developers has resulted in what is called programming paradigms- a set of programming
languages that have certain features and capabilities, with all languages falling either under
imperative programming paradigm or the declarative paradigm.
The imperative paradigm, also referred to as procedural programming paradigm describes
the traditional programming approach in which the processes involved are defined by the
language being used, and arranged as a sequence of commands that when adhered to, data
manipulations are bound to take successfully take place hence reaching some desired output. It is
an approach through which problems are solved using commands packaged together in a
sequence of events/discrete logical steps called algorithms. Declarative programming paradigm
on the other hand refers to a programing paradigm in which a developer describes the problem
they want solved rather than solving it themselves. This approach follows a pre-defined and a
general purpose problem solving algorithm when solving the problems presented to it. Rather
than manipulating data and data structures through following a predefined sequence of steps, a
developer using declarative programming paradigm just describes a problem they want a
computer system to solve, and their main work here is design the general purpose problem
solving procedure once and for all (Glenn, 2005).
Document Page
PROGRAMMING PARADIGMS 3
Under the imperative programming paradigm are two broad categories of languages-
procedural and object-oriented programming languages while the declarative paradigm presents
to the world functional and logic programming languages.
Object oriented programming refers to programming languages that looks at the world as
‘objects’- and models real-life situations using objects. These models compartmentalize data into
data fields, describes the contents of the objects together with its behavior by using classes
(group of objects of the same type), and methods. Among the features of these
programming ;languages are encapsulation- hiding object’s contents behind some well-defined
boundaries, polymorphism- a feature that allows objects and classes to take many forms and
inheritance- which allows children classes to inherit features from parent classes. Examples of
such languages are VB.NET, Python, Java, the C-family language, Scala, Ruby, JADE, and
Smalltalk. The advantageous thing of these languages include scalability- allows one to work
with them without any limitations, and creates a separation between data and method hence
preventing any unnecessary manipulations, and eliminating programs from error vulnerabilities
(techopedia, n.d.).
Procedural languages on their side of the flip executes a set of instructions through a
sequence of steps that tell a computer what to do. The languages make heavy use of powerful
functions, constructs and control structures that control execution procedure in a program
(analytica, n.d.) Examples of such languages include COBOL- common business oriented
language, FORTRAN- formula translation, C, and Pascal.
Functional programming, as an approach to declarative programming refers to a software
building process through composing of pure functions (Eric, 2017), thus helping us to avoid any
instances of shared data and mutations. Under this paradigm, one relies on declarations rather
Document Page
PROGRAMMING PARADIGMS 4
than statements, and value outputs here depend on arguments that are passed to the functions
(Cody, 2017).Functional code is more predictable, concise, and easier to test than tit is the case
with imperative and object oriented programming languages more specifically. Functional
programming hosts various features such as functional composition, immutability, and shared
effects and are more re-usable. Such languages include JavaScript.
Logic programming is another form in which declarative programming is achieved, and
is used to describe programming processes in which statements express facts and rules in regard
to the problems at hand, and within the formal logic of a system. Rules written in logical clauses
consist of a head and a body while facts are similar to rules in expression, except that they do not
have the body section (Computer Hope, 2017). The statement “A is true if B, C, and d are true”
is a rule- that directly dictates on the outcome of the program, if the body section fails, then the
header section returns false as well and the statement “A is true” is a fact- no body section.
Examples of logic programming languages include Datalog, ASP- Answer Set Programming,
abyss, Alice, CHIP, Alma- 0, and Fril among many others.
The advantages of such language include the ability to express inference rules and facts
out of and separate from control flow and allowing developers to focus on knowledge model
rather than the statements thus making extension of the knowledge model easier.
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
PROGRAMMING PARADIGMS 5
References
analytica. (n.d.). Procedural Programming. Retrieved May 23, 2018, from analytica:
http://wiki.analytica.com/index.php?title=Procedural_Programming
Cody, A. (2017, August 24). Functional Programming – What Is It and Why Does It Matter?
Retrieved May 23, 2018, from keycdn.com: https://www.keycdn.com/blog/functional-
programming/
Computer Hope. (2017, september 15). Logic programming. Retrieved May 23, 2018, from
Computer Hope: https://www.computerhope.com/jargon/l/logic-programming.htm
Eric, E. (2017, January 03). Master the JavaScript Interview: What is Functional Programming?
Retrieved May 23, 2018, from Javascript Scene:
https://medium.com/javascript-scene/master-the-javascript-interview-what-is-functional-
programming-7f218c68b3a0
Glenn, B. J. (2005). Computer Science An Overview (9 ed.). Greg Tobin. Retrieved May 22,
2018, from http://infocat.ucpel.tche.br/disc/icc/docs/CSAO.pdf
techopedia. (n.d.). Object-Oriented Programming (OOP). Retrieved May 23, 2018, from
techopedia: https://www.techopedia.com/definition/3235/object-oriented-programming-
oop
chevron_up_icon
1 out of 5
circle_padding
hide_on_mobile
zoom_out_icon
[object Object]