Clean Architecture — Programming Paradigms

A chapter in which Uncle Bob tells us all about the most popular programming paradigms.

Jan Stoltman
3 min readSep 2, 2018

About this article

This is a part of my series of articles where I go chapter-by-chapter through the “Clean Architecture” by Robert.C.Martin and share my thoughts, analysis and pieces of knowledge I’ve gathered. Previous part can be found here.

“architectural photography of glass building” by Christian L on Unsplash

Structured programming

The first paradigm to be widely adopted in the programming world was structured programming. It was discovered by Edsger Wybe Dijkstra in 1968. Dijskra has claimed that the use of goto statements (unrestrained jumps) is a bad practice and can be harmful to program structure of a project. He has proposed and implemented a few replacements for the good old goto statement in the form of if/then/else and do/while/until flow constructs.

Structured programming imposes discipline on direct transfer of control.

Object-oriented programming

Next came the object-oriented programming, although it was actually discovered two years before structured paradigm, in 1966, by Ole Johan Dahl and Kristen Nygaard. They have noticed that in ALGOL language, the function call stack frame could be moved to a heap. It allowed local variables declared by function to exist long after the function returned. The function then became a constructor for a class, the local variables became instance variables and the nested function became methods. This also led to the discovery of polymorphism thanks to the disciplined use of function pointers.

Object-oriented programming imposes discipline on indirect transfer of control.

Functional programming

The third paradigm, was the first one to be invented and the last one to be popularized and widely adapted. It’s invention predates computer programming as we know it. Functional programming, which just now gets a lot of renown, is a direct result of l-calculus invented by Alonzo Church in 1936. His l-calculus became the foundation of the LISP language, invented by John McCarthy in 1958. A basic rule of functional paradigm is immutability, which means that values of symbols cannot be changed once they have been set. This pretty much means that there is no assignment operation in languages which follow this paradigm (actually there is, it’s complicated and I’ll come back to this in one of the future articles).

Functional programming imposes discipline upon assignment.

Taking away, not adding

It’s worth noticing that all these paradigms don’t offer the programmers any new tools or possibilities. All they do is taking away capabilities and setting up restrictions and weird rules. They tell us what not to do, rather than what to do.

Structured programming takes away gotos, OO takes away function pointers and functional programming takes away assignments. If we join all three together there is pretty much nothing left to take away from programming, that’s why no new paradigm has been added since 1968.

Ties to architecture

Ok, but what does it have to do with the actual software architecture?

Well, every piece of architecture is built upon one of these paradigms, good software architect leverages constraint provided by these paradigms and uses them to project’s advantage.

Summary

I encourage you to share your feedback and point of view with me, it’s the best way for all of us to learn and grow. Also, check out the complete book, it’s a really wonderful source of knowledge for any developer. My articles are just a shallow summary of information that can be found in this book, do yourself a favor and read it whole! Next part of this series can be found here.

--

--