Read more
However, after some time, the chef abruptly changes the recipe: from now on, Svan salt will have to be used for the puree. Consequently, there will be 20 g of regular salt left on the shelf instead of 10 g. The chef uses them to make pumpkin soup. As a result, the client is served an oversalted dish. Approximately the same thing happens when writing a program.
Functional languages do not have side effects. Therefore, objects cannot change in them. In vietnam rcs data other words, a function does not change the old object, but returns a new one. Imagine that a person would buy a new calendar every day, although he could simply turn the page. The translator can often prevent unnecessary expenses. This application chooses how the code will be executed.
Comparison of programming paradigms
Let's look at a specific example. Let's take a few numbers:
5, 1, 3, 9, 12, 583, 998, 7538, 72, 53, 71, 85, 7, 2, 9
The task is to get from this series all numbers that are greater than 3 but less than 100.
Comparison of programming paradigms
Comparison of programming paradigms
If a person writes code using the declarative method, he will need to enter the following command: get all numbers from array N that are greater than 3 and less than 100. The programmer does not care how the program will solve the task. He only needs to formulate the desired result.
Golang Books You Should Definitely Read
-
- Posts: 63
- Joined: Sun Dec 22, 2024 4:05 am