How to I avoid delaying difficult code when I see it?

I have to admit, whenever I see a chunk of code which I cannot understand or any code thing that I cannot do, I pick up a new website to browse to use mobile, while the problem is there. It has greatly been a problem for me and I am tired of it now. Does anyone know how they overcame such a problem?

Hmm I’m not sure what you mean by “I pick up a new website to browse to use mobile”. If you mean looking up help to learn code then yea I do that sometimes, as does pretty much everyone.

Odds are you wont be able to remember 100% of everything you learned, so you need some kind of reference and that is ok! The key is not being able to memorize everything, but rather be able to learn anything. You will be able to learn a few things here and there that will stick, but some things you just wont be able to memorize perfectly and that is ok. Give it more time, practice on it, and look for help.

The only situation I’d keep an eye out for is if you find yourself looking up more and more things that you should already know. Its one thing to get help with tricky code, its another to get help for any code. If your struggling with common code, then focus on practicing with that code so its more familiar. There is no replace for practice.

Finally, brushing up on existing skills can help solidify them in memory. Doing challenges in FCC, or using other sites like codewars can give you more time and places to practice against code. Looking at the solutions is fine as long as you go back and try to implement them to further your understanding.

Hi, I mean to say if I get stuck in a problem. I get distracted and avoid the problem solving by browsing news website or picking my mobile up.

If you find yourself having issues staying focused when presented with a challenging problem and looking for distractions, the fix is as simple as removing yourself from distractions.

When I find myself going up against a difficult problem I remove as many distractions as possible. I personally don’t use social media anymore so its easy to not check anything. It takes some discipline, and grit to stick with a difficult problem over time. I find myself getting competitive where I have an attitude similar to “This bug wont beat me!” and keep pounding away.

Setting yourself up for success is just as important as being able to stay focused. If your sitting in your room that is filled with distractions, odds are you going to get distracted. If you go somewhere where there is nothing for you to get distracted by, you will focus much better. It could be a library, or just another room. Turn off your phone if your distracted by it, close extra social media tabs and use “zen” mode or something similar in VSCode or anything similar with your given editor to fully emerse yourself with the problem.

Finally, don’t try to sustain this non-stop all day, getting a few minutes in focusing on a difficult problem is all you need to make good progress most of the time. Something like the Pomodoro technique can be used as a routine of getting focus in, while still being able to be distracted.

Good luck hope it helps :slight_smile: