Member-only story

Functional vs Procedural Programming and Declarative vs Imperative Programming

Ismat Samadov
8 min readApr 10, 2024

--

Photo by AltumCode on Unsplash

Programming paradigms are fundamental approaches to software design and development, each offering distinct methodologies for solving computational problems. Among the prominent paradigms are Functional and Procedural Programming, each with its own set of principles, techniques, and applications.

Functional Programming

Functional programming (FP) revolves around the concept of treating computation as the evaluation of mathematical functions. It emphasizes immutability, referential transparency, and higher-order functions. In FP, functions are first-class citizens, meaning they can be passed as arguments to other functions, returned as values from other functions, and stored in data structures.

Key characteristics of Functional Programming include:

Immutability:In FP, data is immutable, meaning once a value is assigned to a variable, it cannot be changed. Instead of modifying existing data, FP encourages the creation of new data structures through transformations.

Referential Transparency: Functions in FP have no side effects and always return the same output for a given input. This property simplifies reasoning about code and facilitates equational reasoning.

--

--

No responses yet