Have you ever been in a situation where you thought that task would be easy peasy but it turned out different?
I remember once I got the task to fix some warning messages in our React Native app. It was a warning caused by the web view library we used.
I thought it's gonna be an easy fix with just updating the package to the newer version.
I gave my manager an estimate of 1 hour to do this task, as I thought it would be more than enough to update the npm package version.
Boy, I was so wrong!
As soon as I updated the package to the newest version, I couldn't build the app anymore.
Errors just started to flood me. I was going from one error to another. Just like Hal from "Malcolm in the Middle":
It was hard to fix this as it was the React Native version 0.59.9 (if I remember correctly) and they introduced the AndroidX breaking changes in the 0.60.0 version. A newer version of the web view library forced me to upgrade to the React Native version.
The update from one version to another was a nightmare.
In the end, I did it, but spent the whole 3 days on it.
Why does this happen?
There are always multiple factors included but some of them are:
Bad planning or no planning at all
In my example, I spent 0 (zero) minutes thinking about approaching this task. My plan was:
- update the package and it will work
- build the app to test the changes
- push the code changes
I was so young and naive and I didn't think at all what could go wrong.
I could ask myself some questions and make a valid plan. Instead, I got burned by Murphy's law. Things got complicated and slowed me down.
Thinking something is simpler than it is
I am a big fan of "The Chase" quiz.
In one episode, 2 guys were left for the final chase with only 5 miserable right answers. Usually, you need at least 15 steps to have some chance against the chaser.
Their opponent was Dean Kotiga. Dean is brutal. In my opinion, the strongest chaser here in Croatia.
Still, he failed to catch them:
Sometimes, things that look easy might have more steps or details than you think at first.
In my case, if I were more experienced in the situation above, I would come up with a proper plan and think ahead.
Some of the things I could think about in advance:
- What if an update to the new version has breaking changes?
- What if I need to change my code after the package update?
- What if other packages are dependent on this version?
- What if the React native version has problems with the new package version?
All of these would result in giving a better estimate and not underestimating the task.
Sometimes life slaps you in the face so you come down to earth after you get burned.
This happened to me because I was cocky and overconfident.
Remember to be professional and treat every task with dignity, no matter how simple it looks.
How to fix these mistakes?
There are multiple things you can do to avoid these pitfalls.
Having a plan is the first step you need to do. But you must include risks in the plan.
Think in advance about what can go wrong.
Developers are by nature super optimistic in the first years of their job. This mindset slowly shifts as you gain more experience.
Think about possible problems and make plans to deal with them.
Break the task into smaller sub-tasks
Before you begin actual work on the task, plan and divide the task into smaller bits. Plan for each step.
It is easier this way as you can feel the progress. With this feeling, you are more productive and feel better. At least, I feel that way.
I also like to leave slightly unfinished work for the next day. Let's say I did 90% of the task. I will leave it for the next day, so tomorrow morning when I start I can knock off one task from my list easily.
This way, I already completed 1 task that day and I feel better moving on to the next one.
Taking big tasks and working multiple days on a single task is never fun.
Be honest and realistic
Sometimes circumstances will pressure you to work under unfavorable timelines.
This can happen but it's important to be honest and realistic.
Do not give an optimistic deadline because your manager pressured you to do so. Or because the client decided in advance that the project must be delivered on a specific date.
If these things happen, speak openly and say what you will be able to do in that amount of time.
It's better than promising something and later failing to deliver it.
Also, be realistic to yourself. It's not fair to work overtime because of unrealistic deadlines. If you must do so, ensure your manager knows and approves this. These situations should not be often.
Think about past experiences or ask for advice to set a reasonable time and approach for the task.