Let’s say I’m setting up a blog. “Do I use plain HTML and CSS? But wait, that’s too basic.”. Then let’s use a React setup. Scourging the web, days of research and POCs later, the final thing I end up with is a stack with React, Redux, Styled Components, Typescript, Redux Saga and (an immensely optimised and complicated) Webpack setup.
But is it really necessary? All I wanted was a platform where I could jot down my thoughts. I didn’t have to build an E-Commerce app like Amazon or something. “But I was just building a robust solution for my project.”
Just because we have a lot of options to choose from, doesn’t mean we have to use all of them. It’s like cooking with spices and seasonings. Different recipes need different spices, some less, some more. If you use chilli sauce while baking a cake, it’ll just ruin it.
Then how do you build out a good solution?
Here are a few small pointers for you.
Start small. Don’t jump into the biggest baddest solution out there, just because it looks cool. Use a solution that is required for the current problem. Sometimes, less is more.
Choose the right solution. The most popular solution might not be right one. React might be in trend right now, but maybe for a form heavy application, Angular or Vue could be better.
Think a few steps ahead, but don’t try to predict the future. While building a solution it is always important to look ahead and keep room for expandability, but at the same time don’t put stuff in which might not ever be needed. That’s just one more thing that you’ll need to maintain.
Modularise. Try not to get locked in. Keep each piece of your solution as modular as possible. That way, it’s much easier to work on, refactor, or even replace in the future (if required).
How to maintain a good solution?
Creating something from scratch is easy, maintaining it is hard. Here are some tips
Hacks are good, but they should not be stop-gaps for a tech-debt.
Refactor your code regularly. As soon as you feel your code feels suffocating, or it’s getting difficult to work on, REFACTOR, or trust me, it’ll come to bite you later.
Stick to the path you set on. Making very big changes (especially architectural) is not a great idea. It’s not impossible, but generally it’s a pain in the ass and causes loads of hidden errors.
At the end, don’t be afraid to start fresh. If things are not working out, don’t waste time to fight it. Sometimes, it’s just much faster to start from fresh than trying to fix it.
That’s all folks. At the end of the day stop thinking too much and just build something. It’s a lot more simple, fun, satisfying and gratifying once you start something. Remember how static friction is much more difficult to overcome than dynamic friction? Get the ball rolling, you’ll get there eventually.