Have you ever wondered if you were a slow programmer? Did you feel frustrated after coding for several hours and you still didn’t arrive at a solution? This is a common problem almost all developers face from time to time in their career. You get stuck on a problem, and everything seems to go downhill from there.
I have faced this situation several times and there are some things you can do to help alleviate the slowness. Coding is a skill, and you get better at it with time.
Practice, Practice, Practice
The more time you spend coding and solving problems, the faster you get. The famous saying Practice makes a man perfect, applies to coding as well.
Practice makes you perfect!
With practice and frequently coding you get faster and efficient at it. Practice will get you faster at doing all of the tasks below:
- Working with your IDE and tool set.
- Thinking about a problem and solving it.
- Finding solutions.
- Know where to look for help.
- Coding and knowing the syntax.
Without practice, all of these tasks take up time, and adds to the overall time you take to code. With a lot of practice you will notice that eventually things get faster.
Many times I have noticed that if I am stuck on a problem for hours, just taking a break for a few minutes, going for a walk, or having a drink and getting back to the problem really helps. It helps in giving me a fresh perspective on the problem that I am trying to solve. Taking frequent breaks is really helpful for developers, even for their health.
If we were to sit still and code on our laptops all day long, we will have to face serious medical problems in terms of our wrists, shoulders, neck, back and so on. Frequent breaks help not only to freshen up our mind, but also helps in our overall well being. Sitting in the same spot all day, is just not how humans are designed to function.
Make sure you take short breaks often, and notice that your productivity shoots up. Trust me on this one.
Pick The Right Tools
Your toolset makes a world of difference in your productivity. Make sure you pick the right tools for your development.
We are in the modern development era, where there are plenty of tools available to make the developer experience smooth and easy. Depending on your domain, pick the tools that will help you do your job faster.
Let’s say you are a frontend web developer. There are plenty of modern web development tools like webpack, babel, etc.. that help you with your development process. We have a blog post that has a section on tools to learn and use for frontend web developers. You have tools that help you with design, code formatting, error handling, continuous integration, testing, debugging, deployments and so on. Keep in mind that coding is only a small portion of a software developer’s job. There are other tasks that take up time as well, and having the right toolset makes the developer experience far better.
Note: Picking the right tools is an important responsibility and needs to be done as a team effort.
Something that can give you a huge productivity boost is how you organize your time, and allocate time to focus.
Let’s say you work with a big team and this is what your typical day looks like:
- You start your day with emails, responding to slack conversation from other co-workers.
- 20 minutes later, you are ready to start coding on a feature.
- Your coding intensively, and 15 minutes later, it is time for daily standup.
- It is daily standup time, you meet and greet, and it lasts about 15 minutes.
- You are back to your desk, and start coding again. It takes you another 10 minutes to recall what you were working on and get back in the groove.
- 20 minutes later, it is team meeting time.
- It lasts about an hour, and you are back to your desk.
- You start coding again. It takes you another 10 minutes to recall what you were working on and get back in the groove.
- This keeps happening over and over again…
If your day looks like this, the biggest challenge for you is the lack of focus.
With constant interruptions, you will not be able to give your 100% towards design, architecture or code. Experts recommend that you block off your calendar frequently for an extended period of time. I like to block off my calendars typically in the afternoons and call that the focus hours. Encourage your peers to do the same.
Block off your calendar for extended block of time (2-3 hours). These are you focus hours.
During focus hours you do the following:
- Mute all notifications
- Do not look at your phone
- Do not have any meetings scheduled
- No slack, no email and no interactions
You can schedule your focus hours few times a week, and trust me it would have a significant impact on your productivity. The uninterrupted focus makes sure that you can code and solve problems faster.
This is why you may hear from remote developers that they get a lot done everyday without going to work. This is because they don’t have a ton of interruptions like the office goers. It is way easier to focus as a remote developer. A lot of companies are going the remote way these days to give the flexibility and gain the most productivity from their developers.
Code For Current Requirements
All of us software developers are quite ambitious. We want to solve all the world’s problems with our beautiful code. But, there is something we need to keep in mind. When we are working on a feature, it is important to design and code for the requested requirements. It is good to think about the future, but there is no need to over complicate the feature and add additional scope to the features. Before you begin coding, make sure you have the requirements that everyone agrees upon, and work on that alone. Do not try to add complexity to your code, to solve problems that do not exist.
For example, if you are asked to build a page that displays five items. You have to build just that. You do not need to add complexity to this problem and add additional features for scrolling, pagination, and so on. Because the list may never grow. It may just be these five items only. Your additional code for scrolling the list, paginating, searching and so on, are rather useless for this scenario.
Adding unnecessary complexity, only makes you slower and does not help the codebase or the business. I am not saying, don’t think about the future. All I am saying is do not try to solve problems that don’t exist and not in the scope of your product.
Simple code is important, and easy to manage and maintain.
So next time you see someone coding super fast, it means they have been working on these skills, to facilitate them to be productive. I hope you enjoyed this post.
Checkout Code With Mosh Courses to equip you with knowledge beyond basics on different programming languages.
Here is another article from us on becoming a better developer that you may find interesting to read.
If you liked this post, please share and you can follow me on twitter @AdhithiRavi