You can plan. You can measure twice and cut once. You can think ahead.
But at the end of the day, sometimes the universe pulls its goalie in the middle of the period.
Now what? Now, you dig in and find solutions. You improvise. You could never have foreseen the current situation, so don’t get hung up. Use a different part, move that functionality into a different module, change the API, find a different supplier, bend it and hit it with a hammer.
My favorite scene from the movie Apollo 13 takes place a short time after the famous, “Houston, we have a problem.” A group of engineers stands around a table staring at a mish-mash of pieces and parts available to the spacecraft crew. Their mission is to turn that pile of stuff into an air filter because C02 buildup is slowly asphyxiating the crew (here’s a great article on what they did).
Here’s what you got. Do it, or people die.
There is no higher compliment that can be paid to a boots-on-the-ground engineer than “Wow, that’s clever.” Clever solutions happen at the intersection of creativity and knowledge. Now, put that engineer on stage with a crowd of people asking him to create a clever solution on the spot. That’s improvisation.
Don’t be afraid to go off-script.