The profession of developer has become both highly specific and so broad that it’s easy to get lost. As a recent example, a strong media hype surrounding artificial intelligence has prompted alarming predictions from some prominent researchers that our profession will be wiped out entirely. However, we are not coding machines, and the complexity of our knowledge cannot be summed up in this way.
It’s essential to keep an eye on emerging practices; this approach is commonly referred to as technology monitoring. In this article, I invite you to take a look at the various major principles and schools of thought that exist today. What they advocate, why, and their philosophy.
These principles, which I intentionally call “dogmas,” are powerful ideas that have emerged over time. They combine both good web development practices and techniques designed to make the developer’s job easier. Let’s get started!
Apply Clean Code, for readable code!
Published in August 2008, the first edition of Clean Code is first and foremost a reference work that we owe to Robert C. Martin, the aptly named Uncle Bob.
This book offers programming guidelines aimed at improving the readability of the code we create, and therefore, making it easier to maintain.
To learn more about this essential web development best practice, I invite you to read my article “ Program, yes; but program cleanly! ”.
Use Hexagonal Architecture or Clean Architecture
Software architecture is an important part of our work. To ensure viable solutions, we need to start at the beginning: the foundations.
If you were building a house, few of you would start with the roof and walls: we would first lay the foundations of the structure. The same procedure applies to software. It is necessary to establish the main axes to follow in order to maintain a clear, easily maintainable, and ultimately resilient project.
This is where hexagonal architecture and clean architecture become so interesting.
Let’s start by distinguishing these two solutions: hexagonal architecture proposes a port and adapter pattern (which represent the links between the application and the outside), while clean architecture incorporates various web development best practices aimed at improving the robustness of the solution. These two methods share the principle of dependency inversion, which requires us to no longer depend on implementations, but on abstraction. As a result, high-level modules must no longer depend on lower-level modules.
Hexagonal Architecture
This means that any application logic should never depend directly on an external system, such as a database, for example. This isolation creates a high resistance to change, because external modifications will never impact the application logic.
This isolation is made possible by ports within the application and adapters on the outside.
Diagram of a hexagonal architecture
Although technically, ports represent interfaces, it is possible within the hexagonal architecture to encounter primary ports in the form of a concrete class. Ports will thus represent the contracts to be respected to communicate with the application’s internals. The application is controlled by external actions that will use adapters to communicate. These adapters are ultimately classes that implement the interfaces, that is, that ensure the contract with the application’s port.
