Importance of Tracer Code

John Au-Yeung
Jun 6 · 4 min read
Image for post
Image for post
Photo by Manja Vitolic on Unsplash

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

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.

Flexible Architecture

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

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

This way, they’re decoupled but can be combined like real building blocks so that they can easily change and tested.

Image for post
Image for post
Photo by Jamie Street on Unsplash

Benefits of Making Tracer Code and Modular Code

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.

Conclusion

Therefore, it should follow all the clean code principles and be prepared for the code to be used in the long term.

The Startup

Medium's largest active publication, followed by +731K people. Follow to join our community.

John Au-Yeung

Written by

Web developer. Subscribe to my email list now at http://jauyeung.net/subscribe/. Email me at hohanga@gmail.com

The Startup

Medium's largest active publication, followed by +731K people. Follow to join our community.

John Au-Yeung

Written by

Web developer. Subscribe to my email list now at http://jauyeung.net/subscribe/. Email me at hohanga@gmail.com

The Startup

Medium's largest active publication, followed by +731K people. Follow to join our community.

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store