Solitude

Solitude is a funny thing to write about. I don’t think there is much virtue in describing the state itself, because one has to endure it themselves in order to fully understand it. This is probably…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




How To Increase Development Velocity by Future Proofing Your Code

Help your future self by writing flexible code

When we first learn to code, it's hard to think past the initial requirements of the story we are working on. You already have lots on your plate with design, unit tests, edge cases, etc. Let alone worrying about how it will affect your app months from now. But this is critical if you want a flexible code base that is not difficult to maintain.

As engineers, we want to be learning and improving our trade constantly. Small gains compound into big achievements in productivity.

Layering your code so that you separate the stable pieces from dependencies that could change in the future will allow you to be prepared when you need to swap out a service or technology for a new one.

Programming is a constantly changing field, and a lot of times, it's hard to keep up. One technology you are using might not be what you need in the future. This means to be able to make changes fast, we need to abstract code properly.

Abstraction is not only adding layers of interfaces. It also is important with naming conventions. It can be hard to rename something after we have already created and exposed it, so it is important to consider it before implementing code. We can prevent huge time-consuming changes by naming the providers by what they do, not who is doing it.

Let’s say your company currently uses BigBrotherAnalytics, and you’re tasked with adding tracking to your page. So you create a class for creating the BigBrother instance with a track function. You instantiate and call the track function when you need to trigger a track event. This is what that looks like:

Add a comment

Related posts:

Abuse in care

The proposed Commonwealth redress scheme for victims of child sexual abuse is a first step toward creating a national redress scheme. Should a national scheme result, it will be unlike any other in…

Mysterious Desires

As she walked through the crowded streets of the city, Claire couldn’t shake the feeling that someone was watching her. She had always been a bit paranoid, but this felt different, almost like a…

The 20 celebrities who will be glad to see the end of 2022

The countdown celebrates those who have made a mark, broken new ground, and shown general all-round awesomeness. So for the sake of fairness and balance, this is a look, in no particular order, at 20…