Clean architecture. Part II - Programming Paradigms

This series is a free and very short retelling of Robert Martin's (Uncle Bob's) 2018 book Clean Architecture. Start here .





Programming paradigms

The discipline, which later became known as programming, was conceived by Alan Turing in 1938. In 1945, he already wrote full-fledged programs that ran on real hardware.





The first compiler was invented in 1951 by Grace Hopper (the grandmother with the Cobol tattoo). Then programming languages ​​began to be created.





Paradigm overview

There are three main paradigms: structural , object-oriented, and functional . It is interesting that first functional programming was discovered, then object-oriented programming, and only then structured programming, but they began to be applied everywhere in practice in the reverse order.





Structured programming was discovered by Dijkstroy in 1968. He realized that goto is evil, and programs should be built from three basic structures: sequence, branch, and loop.





Object Oriented Programming was discovered in 1966.





Functional programming dates back to 1936 when Church invented the lambda calculus. The first functional language, LISP, was created in 1958 by John McCarthy.





Each of these paradigms takes away capabilities from the programmer, rather than adds. They tell us what we don't need to do , rather than what we need to do.





All of these paradigms are very architecture related. OOP polymorphism is needed to communicate across module boundaries. Functional programming dictates to us where to store data and how to access it. Structured programming helps in implementing algorithms within modules.





Structured programming

Dijkstra realized that programming is difficult. Large programs are too complex for the human brain to control.





, , . , if, do, while, , .





goto .





, .





, . «» : . , . , , .





-

– , , .





, , .





, C. Java, , . , - .





, . , - .





, , . - , .





– . () . , .





, . , . , , : , , .





. .





, , . , .





. , .





? , . .





, . . , .





Event Sourcing. , , . , , . , . , , , .





Thus, each of the three paradigms limits us in some way:





  • Structural takes away from us the ability to insert goto anywhere.





  • OOP does not allow us to access hidden members of classes and imposes dependency inversion on us.





  • FP prohibits changing variables.





To be continued...








All Articles