Skip to main content

More than one way to skin a cat

Software Engineering is one engineering field where there is always more than one way to solve a problem. Now this can be a blessing or a curse depending on the situation.

There are so many instances I have seen where developers argue to nth degree which is the right way to solve a problem or write code. Should code be centralised or should be near to place where it is used? How do we make sure we dont miss updating the code if the code changes somewhere else in future? How do we make sure if someone else picks up the code and doesn't follow the convention?

It is like as if you are building an extension to your house and the builder will use complete different bricks and not check what colour of bricks were already there even though it is right there in front of his eyes.

So how do we solve the problem? How can we help the team to focus on the solution and not gold plate the solution?

This is where patterns and principles come in. People have solved problems, If you study patterns, you will find a solution. If you know principles like SOLID, DRY, KISS can be handy.

In the end the code should be readable, simple, performant, maintainable and testable.

Is that difficult to achieve?


Comments

Popular posts from this blog

Why there is semicolon at the start of a JavaScript function?

Very often while reviewing the code for my team, I will come across a semicolon at the start of JavaScript function as show below ; (function () { 'use strict'; ...and I often wondered what purpose it served. Guess what. It is an insurance to make sure your script works fine when all other scripts are merged together;  The leading ; in front of immediately-invoked function expressions (iffe) is there to prevent errors when appending the file during concatenation to a file containing an expression not properly terminated with a ;. So there you go. Now you know what that little semicolon is doing there in your code.

What is Event Sourcing?

If you scratching your head and wondering what is Event Sourcing, this is a very good article to start. https://www.erikheemskerk.nl/event-sourcing-awesome-powerful-different/ I couldn't have explained it any better.