Programming Paradigms

Anvesh
SilentTech
Published in
2 min readApr 23, 2024

Programming Paradigms define te style in which a program can be organized.

Imperative Programming: It’s a step-by-step flow where computer will follow the order. The main focus is on how to achieve the goal. The paradigm consists of several statements and after execution of all the result is stored.
Examples: for, foreach loops.
Examples of Imperative: C, Fortan, Basic

Procedural Programming: It’s an advancement to Imperative Programming where few steps are divided into functions and main method will call all functions in order. It has the ability to reuse the code and it was boon at that time when it was in use because of its reusability.
Examples of Procedural: C, C++, Java, Pascal

Declarative Programming: It’s about hiding the complexity. It’s easier to read and comprehend, and often shorter to write.
Example: using LINQ methods instead of writing complex loops.

Object Oriented Programming: OOPS help us to separate businesses into different entities. OOPS make use of classes and objects. The smallest and basic entity is object and all kind of computation is performed on the objects only. More emphasis is on data rather procedure. It can handle almost all kind of real-life problems which are today in scenario.
Examples of OOPS: Java, Python, Visual Basic, c#

Declarative Programming: It’s divided into Logic, Functional, Database.
declarative programming is a style of building programs that expresses logic of computation without talking about its control flow.

Logic Programming:
It can be termed as abstract model of computation. It would solve logical problems like puzzles, series etc. In logic programming we have a knowledge base which we know before and along with the question and knowledge base, which is given to machine, it produces result.

Functional Programming: In functional programming, functions can be assigned to variables, passed as arguments, and returned from other functions. All functions are pure functions.
A pure function is one that relies only on its inputs to generate its result. And given the same input, it will always produce the same result. Besides, it produces no side effects.

Database Programming: It’s based on data and it’s movement. Program statements are defined by data rather than hard-coding a series of steps. There are several programming languages that are developed mostly for database application. For example SQL. It is applied to streams of structured data, for filtering, transforming, aggregating

--

--