Being a nineties kid, I distinctly remember my father, one of Yugoslavia’s programming pioneers, staring day and night at the screen of his Macintosh LC and mumbling into his beard a bunch weird words that I could not understand.
Today, I realize he was neither lunatic nor linguist, but merely a guy struggling to get his work done without the help of the Internet, blogs, vlogs, or even books in his native language. Heck, there were not many people in the entire country whom he could talk to and exchange ideas about coding, problem solving, bug fixing, and, well – being stuck and procrastinating.
Thanks to the gods (and tech geniuses) we now have all of the above, which is why I decided to congregate tips and tricks from as many programmers and developers I could find in my immediate surrounding and across the Internet, into a handy “How To” for all the coders out there stuck in an endless loop of problem solving, sleepless nights, and fighting the Instant Gratification Monkey.
1. Design before you implement
Through conversation with my programmer friends, it turned out that it is a common beginner’s mistake to jump right into writing the code, without first mapping the nature of the problem and the logical paths for creating the solution.
“Due to the proliferation of web and mobile technologies, it has become much easier for developers to hack together a prototype without giving much thought into code design. While giving more emphasis on the design and structure may increase the time taken to write the code, it can save you a lot of time wasted on later refactoring and ’chasing’ the bugs,” explained one of them.
To help yourself with doing this, keep a pen and a piece of paper nearby. Draw maps, outlines, flows, and schemes. Write down all comments and ideas that come to your mind during the process. Put them on the wall, then add or cross off whatever changes in the meantime. Do not constrain the creative process to only what can be typed on the screen, because not only will you miss out an entire spectrum of ideas and potential solutions, but there is also a good chance you will waste even more time later in the process.
2. Do the creative work when you are in the zone
I like to think about programmers as if they were writers or some sort of computer-taming artists. Just like any form of creation, the best product here is usually the one delivered from the state of flow that you are in.
In positive psychology, being “in the flow” or “in the zone” means performing an activity while fully immersed in a feeling of energized focus, full involvement, and enjoyment. One of the fellow programmers described it like this:
“Flow has a big influence on your productivity as it allows you to give all your focus to the specific problem you are solving. Flow is a multiplier of your performance. It is fair to say that when you are programming and not in flow, you are wasting time.”
Unfortunately, not everyone has the luxury of programming exclusively while being fully immersed, but there are some things to help you stick to this wisdom. In order to get into the zone, you need to tackle a certain problem and have enough mental capacity to try out different paths to solution. And it is called “capacity” for a reason – it is very limited, and easily depleted.
So don’t start your day with e-mails. Do not listen to music when you need to be creative unless it is absolutely necessary; and if you do, listen to something with as little lyrics as possible. Do not waste your peak hours on tedious tasks than can be done with half of your brain on autopilot. Instead, batch them together and do them after lunch, in the last hours of your work time, or whenever you feel worn out and incapable of creative work.
In the meantime, let your mind wander and leave enough time and energy for it to create magic.
3. Procrastinate when there is nothing else you can do
Once you start dealing with a certain problem, sooner or later you will encounter a dead end. No matter how exciting, hyperproductivity periods do not last forever, and even the most repetitive tasks require a certain amount of cognitive power that eventually runs out.
This is a red light for you to stop whatever you are doing and simply procrastinate.
Depending on how long you have until your deadline, you may take a shower, go for a run, meditate, do the housework, or simply stare through the window into the sky. Pick an activity that will let your thoughts run in various directions and let your sub-consciousness refactor itself. Later, you will approach the problem with fresh perspective as if it was not you who got stuck in the first place. Chances are the solution will present itself. However, if you really start to procrastinate please start to use some of remote employee time tracking tools such as Workpuls.
However, keep in mind that by saying procrastination, I do not mean anything that is not work. Attention-consuming activities like watching movies, hanging out with friends, or “Netflix and chill” probably will not help you solve the problem, as they will certainly make you more tired, and it will take even more time and focus to get back into the matter of the problem. The best choice, after, of course, good ol’ sleep, are actions that make you physically active and mentally calm at the same time.
4. Gamify your mind
When dealing with tedious and repetitive tasks that aren’t intellectually engaging, or simply with too much work that you don’t seem to be able to tackle, make it interesting by turning it into a sort of competition against yourself. Invent the rules or create some imaginary goals that will make your brain feel like it is playing, and thus the work itself seem like a game.
For example, you may challenge yourself to finish all your daily work in six hours. Make it a big deal – like if you succeed, you’ll finally let yourself binge watch the new season of that show you have been dying to watch; and, if not, you will swear not to check Instagram anymore that day.
5. Use tools
Coding is the craftsmanship of our millennia, so it should be obvious for all developers that using the tools you know well and which suit the job is a prerequisite for effective work. As one guy on Quora said:
“Know your editor like the back of your hand. Don’t reinvent the wheel. Know all of the libraries available in the language(s) of your choice and how to use them. Force yourself to write an example with each library and keep those examples handy so you can review them whenever needed. Once you’re familiar enough with a library, a) you’re more likely to remember to use it when the opportunity strikes and b) you’re more likely to know how to use it and, therefore, resist the temptation to spin your own.”
However, be very careful when choosing the right tools and libraries for your project. Do not use a library that is quite recent and has not been tested much, as it can come back to bite you and become a source of issues that will be very difficult to debug afterwards.
It can be confusing to choose the perfect tool with so many of them on the market nowadays. Since I am not a programmer myself, I suggest that you check out the article with GitHub’s top 7 productivity tools for programmers, or going through recommendations on Quora.
Also, you want to move your ideas into code as fast as possible and avoid doing everything using a mouse pointer. Not only is it slower, but it can also distract you, as it gives your brain enough time to start thinking about something else. Therefore, learn the key bindings for the most important operations in your tools of choice.
In addition to this, it is worth mentioning that there are also tools which are not software-related, but provide enormous help when it comes to organizing, operating, and managing your performance and habits. Smartphone apps like memos, calendars, “pomodoro” timers, and to-do lists help you deal with tedious daily tasks and planning. And, if you work with clients, automated time-tracking tools will save you the hassle of manually tracking how much time you have spent on which task for which project.
Speaking about that, if you happen to use Visual Studio, WebStorm or PhpStorm, you might want to know that WorkPuls automatically tracks tasks and projects that you are currently working on, with no need to click start/stop to do anything at all except for work. It saves your time, lets you focus on what is important, creates fancy reports, and gives some very neat insights about your biorhythm, peak hours, biggest time wasters, and everything else you have ever wondered about your computer behavior.
6. Automate, DRY, & KISS
Once you’ve mastered your set of tools and magic wands (at least for awhile), automate.
Automate everything that you do repeatedly, including command lines, text manipulation, log mining, refactoring, building, deploying, and integrating. Repetitive jobs that can be automated should be some of the first things a developer eliminates from their daily task list. If you spend 30 minutes each day on something that can be automated, you can save around 10 hours a month or 120 hours a year, just by investing 4-5 hours in the beginning to automate it.
With this in mind, follow the DRY principle, which stands for “Don’t repeat yourself.”
It is important that your code can be understood by you and other developers, even when it has been written a long time ago. Nothing is worse than trying to maintain code that has been duplicated multiple times – it is a huge waste of time and will undoubtedly create bugs. It is also a waste of time for all the other developers who aren’t aware of the duplication and need to make changes in the future.
To wrap this all up, obey the cheesy KISS abbreviation, or “Keep it short and simple.”
The real enemy of being productive is the mind of the programmer itself. The more “cognitive load” you place in your head, the less productive you become; therefore, complexity is the enemy. Whenever possible, adopt simple, or dumb solutions: “You can optimize for execution speed. You can optimize for space. But the most precious thing you should optimize for is your own time. Optimize for readability, and understandability.
7. Be smart
You are a developer, which means your time is expensive. Working “a lot” in this situation is not necessarily something to brag about, because if you deliver the same amount of output as somebody who spends less time on it, it will be you on the losing end.
So, what do you do when you encounter a complicated, time consuming problem? Here are some answers from several experienced developers:
“To be honest, this happens so often I think I became able to mentally open StackOverflow within a millisecond. When I was younger, I used to spend hours or even nights and days trying to solve a certain problem, not because it was really that complex or indispensable, but because I’d set an artificial goal to myself to do it, or maybe because I’d wanted to impress someone. In any case, the damage of the time lost was often greater than the satisfaction of figuring it out myself, which is why I decided not to reinvent the wheel anymore unless absolutely necessary, and instead use other people’s solutions. However, remember to always check the ratings and reviews before you implement something borrowed online.”
“Win elsewhere. If I haven’t been able to tackle a problem head-on for awhile, it means that, psychologically, it’s making me deeply uncomfortable. It’s too hot to handle directly. So I switch to doing other, less overwhelming tasks. This way I build my ‘get-things-done’ muscle, because so far, I’ve just been building my ‘get-stuck’ muscle. Once I build this momentum, I switch to the postponed task.”
“If it is something of minor importance and/or urgency, I am not ashamed to delegate or outsource. The internet is full of smart kids who can do amazing things for a reasonable price, so why wasting my time?”
8. Invest time in pair programming and code reviews
You might be the smartest guy or gal in the room, with the best time-management and knowledge of all the key bindings in the world, and, still, there will always room for involving others. Everybody makes mistakes and we want to have at least a second pair of eyes to look over a solution before it goes to production. Therefore, invest in yourself and introduce pair programming, code reviews, or some other collective ownership practice to your development process.
One of the best types of code reviews is when you have a good programmer who is only loosely familiar with the project looking at the code. As you need to explain details, you’ll learn your code better, and sometimes an outsider will see problems that you, as the insider, missed. Code reviews cost nothing but time, and often save much more than they take to conduct.
Finally, I’d like to show appreciation to all devs and programmers who have helped me conduct this article by sharing their experience, whether personally or on Quora. If you have made it this far, you either a) have something really important to do and consider this a convenient way to procrastinate without feeling guilt; or b) find this piece downright helpful and valuable. If the latter is the case, I invite you to spread the word by sharing it with anyone you think might be in need.