Scientific programming

About scientific programming

Image credit: Unsplash

Scientific programming

Science in programming — the past or reality? How much of it is in languages and why are there holivars about the advantages of some languages over others? If you are interested, I ask under the cat.

For a long time there have been “holy wars” in which various approaches in writing programs and in programming itself are discussed and criticized, mainly Object-Oriented Programming is criticized (one, two, three).

Egor Bugayenko criticizes the PLO on practical examples (one, two, video), using the ideas of David West and, as I understood, recently went towards theory. The effectiveness of these disputes tends to zero. Why? Because all these disputes are already being conducted on the basis of the realizations of some thoughts, practices and opinions of individuals, and not on the basis of theoretical works. The scientific method and approach with its theories, hypotheses, axioms, experiments, proofs and facts in recent years in these disputes and “wars” there is no word at all!

In mathematics, as in any other science, any theorems and theories require proof. As an example: The Pythagorean Theorem. Theory comes first, followed by practice. In programming, this approach has not been followed for several decades. Everything has been replaced by dogmas and the opinions of individuals, who are sometimes called “evangelists” or “prophets”. With their verbiage, they promote only the ideas they need to the masses, without caring about theory or evidence (Look at conferences and presentations on IT). Where is science here, and where is religion? And are we not slipping into obscurantism and faith in words written long ago and not requiring proof? Have you heard about the flat Earth supporters? Does it remind you of anything in terms of approaches to persuasion and stubbornness?

And for the last 30-40 years, programmers, blinded by religious beliefs from the preachers of PLO or OP, have been building abstractions on top of other abstractions, new languages on top of other languages, new frameworks and libraries on top of old ones. And why was all this necessary? For the sake of simplification and productivity of their work on writing programs. Only this path led to a dead end. Because instead of simplification, we got complication and now we are studying not algorithms, but APIs and documentation for another fashionable framework, and maybe several. Now they began to look for bugs not only in their own code, but also in someone else’s. Debugging code has to be done through tons of proxies, architecture patterns and design patterns, helpers, frameworks and libraries. And, as research shows, there is no gain in the speed of writing code from the use of OOP at all.

A little history. How did it all start? First there was procedural programming, then structural programming, and then imperative programming came on the scene. Some people thought of introducing the concept of an object — this is how object-oriented programming was born. And at that moment there was a sharp turn that turned the entire industry into the state in which we are now.

The introduction of the object had to be theoretically justified. But that didn’t happen. Instead, each language introduced the concept of an object in its own way. And each developer of the language interpreted the postulates of the OOP to his taste and color. Particularly stubborn fundamentalists came up with Functional Programming based on mathematics, lists and higher-order functions. It sounds serious and even a little scientifically justified, because mathematics is a necessary and useful thing, but what does lists and functions have to do with the real world?

What tasks does pure OP solve without using states and is there an optimal, convenient and correct way on the part of a person — that’s the question you need to ask the “prophets” of OP. And it is asked (one, two).

Functional language developers have started to apply some paradigms from OOP in order to move out of the field of applied mathematics problems into the field of real-world problems. In response, some OOP languages have implemented paradigms from the OP. And “Horses and people mixed up in a bunch” (c)

As a result, the implementation of pure paradigms of OOP and OP in current languages is like in a song — “I made it out of what was, and what was, and I fell in love”! And it turns out that without theoretical work and scientific basis, all these languages are just a figment of the fantasies and desires of their developers. And there are more than a hundred such languages! And it shouldn’t be like this! Ideally, there should be only 2 low-level languages and 3-4 high-level ones built on their basis.

I can assume that when they introduced the concept of an object, they took as a basis what they saw around them — humans and animals. And this was the main mistake that would later grow to a huge size! Thus, inheritance may have appeared (ancestor-descendant and the relationship between them is explained by inheritance, but what about other objects in the world? And what does the very definition of the word “inheritance” mean in the real world? Blood and DNA? Nitrogenous bases?). How do the other terms, namely abstraction, encapsulation and polymorphism, relate specifically to OOP? And somehow they didn’t bother to provide evidence of such a connection. After all, you can write anything and it sounds logical, but the problem is that the arguments given have nothing to do with OOP. After all, a logical mistake was made in the OOP — (incomplete induction) a transition was made from one particular case to the entire general set. To show this, I will give an example — if it is possible to take only living beings with inheritance as a basis, then why, following the same logic, not take a planet or an entire galaxy as a basis? After all, a planet or galaxy is also the heir of other objects from outer space and has a state and some kind of behavior. Or imagine all mountains as objects without inheritance and practically without behavior.

Khusainova Dinara Ayratovna
Khusainova Dinara Ayratovna
student of RUDN

Dinara Khusainova was born in Kazan in the Russian Federation in 2002. Now she is studying at the Peoples’ Friendship University in Moscow.