♨In VScode there is a extention called live server I think, it means that you dont have to refresh browser for code to load. So when I stop focusing I can immediately code something randomly and will display right away, very effective to focus
♨Also plenty of sleep will get you in the zone when you code. The occasional caffiene or for me energy drink appears to boost performance significantly but only for a short time so get your caffiene at your workstation.
♨ Science says that information written in temp memory during the day gets written to permanent memory when sleeping
♨Make sure your project has many steps and that you run the project for every increment, big steps gets you out of zone and mostly lead to procrastination
♨If you are tired stop coding,go for a walk, coding when you really dont feel like it is completly wasted time
♨As someone once said, "to cut a tree in six hours the fastest way is to sharpen the axe for for the first four".
These tips work for me
I can't say anything about the focussing part.
You will only remember what you understand, and the best way is to apply what you learned.
Furthermore, a good repetition schedule prevents forgetting.
I use this pattern:
Master Oogway your right! Completely dropped the ball on that one.
Got mixed up with George Washington and the cherry tree, the actual quote is attributed to Abraham Lincoln but like most things like this we can not be sure, we dont even know the timframe for the real version.
Edited my previous comment for correctness
First just clear out your mind,calm down and start coding and code like for short term (15 min) walk around for couple of minutes and code again increase the coding time slowly for retention practice again and again and try to create a new program on your own and even trouble shoot the issues.