This repository serves as a demonstration of the differences between procedural, functional, and object-oriented programming paradigms. Suppose we have a task at hand: calculating the sum of the squares of the even numbers in a given list of numbers. Let's explore how this task can be approached in each paradigm.
The task at hand involves calculating the sum of the squares of even numbers within a list. Each programming paradigm offers a distinct approach to tackle this task, showcasing the strengths and characteristics of the respective paradigms.
- procedural_example.py: Demonstrates the procedural approach to solving the task.
- functional_example.py: Illustrates the functional approach using higher-order functions.
- oop_example.py: Presents the object-oriented approach using a class-based structure.
Each example file can be executed independently to observe the implementation of the task in its respective paradigm. Simply run the Python file using your preferred Python interpreter.
python procedural_example.py
python functional_example.py
python oop_example.py
By examining the implementations in procedural, functional, and object-oriented paradigms, we gain insight into the distinct approaches and philosophies of each paradigm. This project serves as a valuable resource for understanding the differences and trade-offs between these programming paradigms.