🌱 Digital Garden

Search

Search IconIcon to open search

Paradigms

Last updated Aug 6, 2023 Edit Source

Different tasks can be resolved using different methods. Those variants are different programming approaches, called paradigms. We will analize two main paradigms:

Remember that almost all modern languages are multi-paradigm, this means they can implement and combine the capabilities of multiple approaches.

# 1. Imperative Paradigm

Key points:

For example, you want to display the phrase “Hello, *<username>*!”. How should the program do it ? following these steps:

  1. Ask the username
  2. Read and remember the username
  3. Display the result

This paradigm is divided in three broad categories:

# 2. Procedural Programming Paradigm

Procedural Programming

# 3. Object-Oriented Programming

Programming languages with Object-Oriented Programming:

# 4. Parallel Processing Approach

Programming Languages with Parallel Processing Approach:

# 5. Declarative Paradigm

This paradigm is divided in three categories:

# 6. Logic Programming Paradigm

Basic statements of logic programming are:

The task here is to find the answer to the query based on facts and rules.

Programming languages with Logic Programming Paradigm:

# 7. Functional Programming Paradigm

Example: You might have a function that takes a list of numbers as input and returns a new list with the squares of those numbers. This does not change the original list of numbers

Programming Languages with Functional Programming Paradigm:

# 8. Database Programming Paradigm

The database program is the heart of the business information system, allowing for file creation, data entry, updating, querying and reporting functions.

# 9. Conclusion