Straight up disclaimer: This isn’t about being a parent. It’s about being a software developer, so stick with me here 🙂
3 years ago, things changed. For the better. I became a father. Being that this was my first child, you can bet there was a lot of apprehension. I’d never even been around a new born for more than a few minutes, and now I was partly responsible for keeping one alive. Things got intense.
Fast forward a few years and things are very different. Sleeping habits, schedules, meals…all that stuff is just a variable. Every day is different. We never know what’s going to happen that day. All this instability has taught me a few things though. These few things, after some time to reflect, prove to be very important in my life as a career software developer though…and today, you get to benefit from my sleepless nights with kids.
Write smaller, single-use functions
Since time is valuable, and there is no shortage of distractions, writing small functions that do one thing, and are easy to read are crucial to success. Kids or not, you have enough distractions in your life that pull your attention away from the project you are working on.
Keeping things small and concise means you can quickly write complete sets of functionality, rather than a large function that, if you step away from, you’ll get lost in. This isn’t just about time management either, functions that do one thing, are easier to write unit tests for.
Budget time for short breaks
Trying to sit down for 8 hours solid and write code just simply isn’t attainable. Not even without diaper changes and family lunch time. Focusing on a single task for that long takes it’s tole on you mentally and physically. I typically find that stepping away from my desk for a quick 5-10 minute break every 60-90 minutes helps with my focus and energy levels. Refill your coffee, take a bathroom break, change a diaper, or just walk around the building once.
The key here is, your mind doesn’t stop thinking about work, but you’re removing yourself from the ability to sit down and write code. This causes your brain to have to think abstractly, which helps you work things out logistically in your head, before going further with your development process. For more information on this type of time management, you should check out the Pomodoro Technique which uses a similar concept.
Consistency Matters
Consistency in the way you name functions, variables, classes, and files is critical to any developers success. In your issue management labels and processing, and in your commit messages. Just keeping things consistant, you reduce your ‘spin up’ time when changing focus, which is more efficient. By using similar patterns in your code, it allows you to anticipate function names, classes, and where code is. You can see a little more on this topic in my slides from a presentation I did at a local developer meetup:
It’s all about time management
As I said in the ‘disclaimer’…it’s about development, not parenting. Parenting just urged these work habits onto me in a way I didn’t expect, but with results that I found were a net positive in my work flow. Obviously parenthood and life changes look different on every person, but I think if you take a step back and try and make your work life flow with your work style, you’ll be much more productive and happy with the work you are doing.
What is your go-to method of keeping yourself on task, and productive in the midst of distraction?