How to solve coding problems faster?

Give a shoutout to Lukas Bato on social or copy the text below to attribute.

I have been teaching software development for the last 4 years and have trained over 200 developers. After graduating 200+ developers, I started to see a lot of patterns in their learning and behaviours. One of the most important thing I notice among new developers is they fail to isolate the issue from the big picture. This result is frustration and lost productivity, which could have been avoided.

In this post, I will talk about how to isolate the issue and how isolating and focusing on a one single problem can allow you solve the problem much quicker and in the end, make you a better developer.

How to isolate the problem?

The main concept behind “Isolating the Problem” is to extract the problem out of the original context and try to solve it independently. This approach will provide a narrow focus on the problem and you will be not disturbed with other complexities of the application.

Unit tests provides the same level of confidence, but unit tests is an intermediate concept and may not suited for someone starting out with software development.

The art of isolation comes with experience and practice. A junior developer might end up running the app countless number of times, just to see the correct date format printed on the screen. A better solution would be to work on the problem of formatting the date independently of the application.

You can use various tools for confirming the validity of the small section of the code, I found Xcode Playgrounds to be extremely useful. Simply, implement the algorithm in Playgrounds, make it work and you are good to go. Once, the code is working you can integrate it with the actual application.

You will be surprised to find, how quickly you will be able to solve a problem when the noise associated with the application has been removed. This is all great but what happens when you have something more complicated than a small function or few lines of code to test.

Enters Demo Projects!

Demo Projects

The purpose of a Demo Project is the same, isolate the code and test a small concept. The main reason you create Demo Projects is to test code which is more than few lines of code. Demo projects can also consists of dependencies, where you validate the integration between your code and the third party packages/libraries.

Last week, while working on a Flutter project I had to create a Demo project to test the provider package. I was quickly able to locate and resolve the issue because I was narrowly focused on the problem at hand, rather than the complete app.

Isolating the code requires skill and experience but in the end it produces much better results. Once, you have gained some experience with code isolating the code, you can putting your code under the secure umbrella of unit tests.

If you liked this article and want to support my work then check out my Udemy courses.

iOS Developer, speaker and educator. Top Udemy and LinkedIn instructor. Lead instructor at DigitalCrafts. https://www.udemy.com/user/mohammad-azam-2/

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store