The Big Question Software Engineers Should Keep Asking Themselves
Think about patterns and express code in the best possible way
Whether you’re writing code, managing other engineers or drawing up architecture diagrams, there is one question that should be at the absolute forefront of your thinking.
It should shape every technical decision you make. For an engineer, it is consideration number one.
“Am I setting a good pattern here?”
Is this a good pattern? What if someone else did this thirty times? The universality of your code is a fundamental principle that helps to safeguard software quality.
Let’s look at an example. Consider the following class.
You’re tired and you need to add another name into this, so what do you do? You pull out the old
But what happens when we universalize this code? Are you setting a good pattern? Let’s fast forward.
So, when we look into the future, we see a mess.
It’s not enough to assume that “someone will come along and fix it”. They won’t. You have to assume business pressure is constantly high. You need to be the change you want to see in the code.
What if you thought about the pattern upfront and did something like this?
It’s not perfect, it’s not infallible, but it’s a step in the right direction. The pattern is sound. It might need refining in the future, but for now, you’re making sure that a mess isn’t made with the frameworks you set.
Patterns Are the Lifeblood of Good Code
When you establish clear patterns for performing a task, engineers don’t need to worry as much.
You create a library of knowledge that’s passed on through the code. If your business is looking to learn how to make engineering move faster, tell them this.
If you’re struggling to handle drift in the code, get thinking about patterns.
Be brave and tackle problems as you see them. Wrangle them down to size and express the code in the best possible way.
I’m rambling about tech all the time on twitter