How to Focus when Programming

There is nothing more challenging at times than working through a really tough problem when programming. Sometimes if you are really stuck on a problem it can be best to step away from it and do something else. I find at times that somehow by almost magic my issue is resolved or I get a different perspective that allows me to come to a resolution. However, regardless expect to put a lot of time and effort into working out a solution or debugging a tough programming issue. Here are a few tips to help you focus better.

  1. Drink More Healthy Energy Drinks

I really enjoy energy drinks but I was concerned about the sugar level and sodium level in those drinks. I went through pretty much everything from Redbull to Rockstar to 5 hour energy drink. For me I settled on Ball Energy Drinks. These energy drinks have no sodium and no sugar. They are effectively sparkling water with 160 mgs caffeine. I find that I am alert without feeling jittery after drinking one. While there a definitely a ton of different options to get your caffeine fix, Ball Energy Drinks are by far my favorite and feel like they have the least downside. I order them in packs of 8 from Amazon just about once a week. You can get yours from Amazon from this link.

2. Talking Out-loud

As silly as it seems sometimes the best way to think through a solution is to talk through it with yourself out loud. I even sometimes speak the syntax of the code I am reviewing and feel like I can then think out my design better. Another good tip is to keep an audio or a video log of your project. Keeping a video log can also be a good way to monetize your content if you desire as well. There are a lot of different options for recording yourself from using quicktime to do a screen recording with audio or simply just use your phone. Although, if you are wanting higher quality recordings some of these recorders may be what you are looking for. They’re pretty reasonable between about $29 at the least expensive to $100 at the top end:

Decent Quality Inexpensive:

Digital Voice Recorder, Homder 1536kbps 8GB Voice Activated Recorder for Lectures/Meetings/Class, Stereo HD-Audio Recording Device with Dual Microphone, Supports 72GB TF Card Expansion – Silver

32GB Digital Voice Recorder,TENSAFEE Dictaphone Sound Activated Recorder, Portable Rechargeable HD Audio Recorder,MP3 Player/A-B Repeat,Voice Recorders for Lectures/Meetings/Interviews/Class

More Expensive:

Olympus Voice Recorder WS-853, Black

Sony ICD-UX560 Stereo Digital Voice Recorder w/Built-in USB w/ 32GB Card

3. Keep a change log and keep multiple versions of code

One of the most important pieces of advise I give especially if you are working in a team is to keep a change log. I have made the mistake before when I am trying to quickly expand functionality to skip this important governance step and as a result I have broken previously functional. This is infuriating and any time this has happened I feel pretty stupid. Therefore, if every time a change is made that change is documented either as a comment in the code or in an change log which can be as easy as a spreadsheet then you will save yourself the time and frustration it will take to reverse engineer each change that you have made up to that point. In the worst case scenario if this precaution is not taken then you will have to revert back to your most recent working version and complete all of your changes again. Just save yourself the trouble and properly document your changes. There are a lot of platforms as well that can support your needs. Jira is a good one that I use on a lot of my projects at work. Additionally, if you’re new to Jira here’s a good book that can familiarize you with administration concepts.

Additionally, version control is very important and can be as simple as backed up code files in a repository like google drive or through github. If you code breaks or your computer crashes you’ll be glad that you backed up several versions in the cloud rather than lose everything because it was stored locally. This advise isn’t necessarily revolutionary but is a necessity and is a scenario where being lazy can be very detrimental.

4. Start with a framework

I know that we all like to just get in there and start coding. This can be a good approach if you are just trying to figure out a piece of functionality. However, you can save yourself a lot of time and rework by taking a step back and thinking more holistically about the design framework for what you are trying to accomplish. An object oriented approach to programming can also help you with design as it requires you to break down each piece of your code into a reusable class. Here’s a good book around object oriented programming that can give you more detail. Additionally, the agile methodology to development can be beneficial when working on team projects. The agile smethod gathering focuses on breaking down the whole project into bite sized chunks and then breaking those out into short sprints usually comprising of a week to two weeks. This method is beneficial as it allows the end users to get their hands on functionality quicker and provide feedback instead of at the end of the project where time and budget are nearly exhausted. If you are interested in agile then here’s an book on the subject that will introduce you to some of the concepts.

5. Create a list

For me I am OCD about my lists. Especially towards the end of the day when my energy level starts to diminish. I structure my day by getting the major activities that take the most amount of focus and energy then I leave the more mundane tasks towards the latter half of the day. However, there are just some days that I really am not that motivated to do much of anything. On those days and really just in general I create lists that describe the activity in low level of detail. When doing this I feel like I have more control over my ability to accomplish the activity as I know all the steps and time it will take to complete. For whatever reason this gives me the motivation to accomplish the activity and allows me to envision its successful completion.

6. Outsource the Mundane

Have you ever had a hard time concentrating on your current priorities because there was something that wasn’t done nagging at you? Or, worse still our ability to focus could be hindered by our limited time and feeling rushed to accomplish a task. Some strategies to overcome this and free more time for yourself could really be as simple as just getting someone else to do it. We spend a lot of time eating or just working around the house. It is as inexpensive as $10 to $30 a week to have a professional come in and clean for your or if you’re on a tight budget you can offer a friend or family member to come by and help out. You’ll be surprised how much time you will get back to focus on your project work and how much better you will be able to focus when your time isn’t spent with mundane administrative activities.

For more programming advise and tutorials please see this link

About the Author

Leave a Reply

Your email address will not be published. Required fields are marked *

You may also like these

%d bloggers like this: