📜 ⬆️ ⬇️

The program for cutting bread

Below is a summary of the previously published post Why I hate frameworks :

In medieval programming times, we applied functions to data. In order to slice the bread, we took the bread structure and passed it as a parameter to the slice function:

();

Then came the era of object-oriented programming. And instead of the function “cut”, we need to ask for “bread” to cut ourselves - we call the method “cut” at the object “bread”:
')
.();

Obviously, this is a significant improvement.

Object-oriented programming has now become even more sophisticated. First, we create the bread slicer object and then just give it the bread for slicing:

= new ();
.();


Progress is evident.

Conclusion: In all you need to know the measure. Sometimes I just need a banana, not a gorilla with a banana.

Source: https://habr.com/ru/post/141505/


All Articles