Skip to content

This little project illustrates the differences between procedural, functional, and Object Oriented programming. Let's imagine we need to calculate the sum of the squares of the even numbers in a list of numbers. Let's see how this could be implemented in each paradigm.

Notifications You must be signed in to change notification settings

Abdelhaq-Bensghir/Programming_paradigms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Programming Paradigms

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.

Example Overview

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.

Contents

  • 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.

Usage

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

Conclusion

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.

About

This little project illustrates the differences between procedural, functional, and Object Oriented programming. Let's imagine we need to calculate the sum of the squares of the even numbers in a list of numbers. Let's see how this could be implemented in each paradigm.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages