Post by ruhaimaromana22 on Nov 9, 2024 23:46:59 GMT -5
The developers systematized approaches to solving various problems, compiled general principles, divided them into groups and called them paradigms - using the example of a salad, we will try to understand them.
Imperative paradigm
Imperative is one of the simplest and most popular paradigms. The main rule: actions must be performed sequentially. For example, when preparing a salad, you must first chop the vegetables, then mix them and add oil at the end.
Procedural programming
Procedural programming is somewhat similar to social media marketing service imperative programming, where the basis is a function. This is a sequence of actions that are recorded and given a name. For example, a recipe for Olivier salad is a function. The developer must know the name of the functions and be able to call them. At the same time, he does not need to understand what processes occur to achieve a specific result.
Object-oriented programming
In this approach, objects arise that launch functions on their own. In the salad example, it looks like this: the dish is prepared by some object that is developed inside the system. In reality, all these functions are performed by the processor, which can be responsible for operations itself.
Take online courses for free
and discover new opportunities
Start studying
Declarative paradigm
Here the developer is required to answer the following question: "What result exactly needs to be achieved?", and not "What actions need to be taken to complete the task?" After receiving the input data, the computer begins to search for a suitable method.
If the programmer describes the result too vaguely, the system may give out something other than what is required. For example, the program was told to make Olivier salad. It starts looking for all known recipes and mixing ingredients, and as a result it may get a salad without peas, then with beef, and so on until the very recipe is found.
Functional programming
In this approach, all functions are pure and have no side effects. You can order Olivier salad 10 times, and all portions will taste the same. In order to avoid side effects (changing the taste of the salad), you need to not just make an order, but list all the ingredients that will be needed for cooking. That is, the function returns a new object each time, so there is no side effect.
If you are a beginner or experienced specialist in AI, ML, Big Data, Data Science and want to create unique programs with artificial intelligence together with your team, then our project "Digital Breakthrough. Season: Artificial Intelligence" will be useful for you.
Imperative paradigm
Imperative is one of the simplest and most popular paradigms. The main rule: actions must be performed sequentially. For example, when preparing a salad, you must first chop the vegetables, then mix them and add oil at the end.
Procedural programming
Procedural programming is somewhat similar to social media marketing service imperative programming, where the basis is a function. This is a sequence of actions that are recorded and given a name. For example, a recipe for Olivier salad is a function. The developer must know the name of the functions and be able to call them. At the same time, he does not need to understand what processes occur to achieve a specific result.
Object-oriented programming
In this approach, objects arise that launch functions on their own. In the salad example, it looks like this: the dish is prepared by some object that is developed inside the system. In reality, all these functions are performed by the processor, which can be responsible for operations itself.
Take online courses for free
and discover new opportunities
Start studying
Declarative paradigm
Here the developer is required to answer the following question: "What result exactly needs to be achieved?", and not "What actions need to be taken to complete the task?" After receiving the input data, the computer begins to search for a suitable method.
If the programmer describes the result too vaguely, the system may give out something other than what is required. For example, the program was told to make Olivier salad. It starts looking for all known recipes and mixing ingredients, and as a result it may get a salad without peas, then with beef, and so on until the very recipe is found.
Functional programming
In this approach, all functions are pure and have no side effects. You can order Olivier salad 10 times, and all portions will taste the same. In order to avoid side effects (changing the taste of the salad), you need to not just make an order, but list all the ingredients that will be needed for cooking. That is, the function returns a new object each time, so there is no side effect.
If you are a beginner or experienced specialist in AI, ML, Big Data, Data Science and want to create unique programs with artificial intelligence together with your team, then our project "Digital Breakthrough. Season: Artificial Intelligence" will be useful for you.