To be a good programmer, we should follow some easy to adopt habits to keep our programming career long-lasting.
In this article, we’ll look at how to make our software systems with tracer code.
Reversibility Of Systems
Engineers want simple solutions to problems. However, things change over time.
Therefore, we have to make our systems that make easily reverse things if we have to.
We got to produce flexible and adaptable software that adapts to the requirements that are given by the business side of the business.
It’s no use that we can write code that doesn’t meet requirements since we don’t want to release things that no one wants.
To adapt to these situations, we should aim to make our code DRY so that we only have to change one place to adapt to changes that are given to us.
Also, we don’t want to make our code be too coupled with any third-party solution.
Therefore, we should aim to make our code decoupled to any 3rd party solution.
We just got to assume that nothing is final in our code and make our code easy to change.
The architecture of our code should be flexible so that we can change them easily if needed.
The flexibility needs to apply to architecture, deployment, and vendor integration.
We got to make sure that our software can easily support the versions of the platforms that we want to target.
If we don’t, then we have to make sure that it can change them out easily.
To make it easier to change third party vendors. We would want to hide the implementation of whatever third party vendor integration code behind an interface so we just reference the interface instead of referencing the underlying implementation of it.
This way, as long as the inputs and outputs of whatever’s in the interface are the same, we don’t have to worry about changing the other parts of the code.
Whatever mechanism we choose for adding integrations to 3rd party APIs, we should make sure that we make the changes reversible.
Write Tracer Code
Tracer code are code that is exploratory so that we can find solutions to our problems easier.
We can write code that we can use to prototype whatever solution we’re building so that we can do that instead of just thinking of hypothetical scenarios.
If we write some tracer code, then we can see some real results to help us make decisions instead of just writing things on paper that may or may not be true in reality.
Tracer code lets us test out new algorithms, languages, or libraries that aren't familiar with so that we can use them to build our solutions more easily when we have to use them to build our final solution.
Tracer code are meant to be kept. when we’re implementing the solution, then we’ll start with the tracer code.
Therefore, we’ve to follow the principles of orthogonality and DRY just like we do with the code in the final solution.
The code would be flexible and easy to change so that we can keep working on it for a long time.
We should assume that the code won’t be tossed out for a long time, so we should make it as pleasant as possible for us and other people working on the code.
Dividing Code Into Modules
We should divide our code into modules and then make them easily combinable.
This way, they’re decoupled but can be combined like real building blocks so that they can easily change and tested.
Benefits of Making Tracer Code and Modular Code
Tracer code and modular code let all of us see something early so we know if something is good or not.
It also convinces stakeholders that we’re making progress towards a project and increase buy-in.
It also gives us early feedback on the things that we’re doing.
Developers have something structured to work with, which is much better than just writing things on a piece of paper.
We don’t have to pull much out of thin air. Instead, we have something concrete that’s used.
Also, we have code that we can integrate with or expand as we work on our project instead of starting everything from scratch later.
It also feels better that we’re making progress on our work.
Trace code will help us explore our solutions and so we can use them to build our final solution later on.
Therefore, it should follow all the clean code principles and be prepared for the code to be used in the long term.