Getting stuck or lost halfway in the work of coding is every developer's daily routine. No one can escape that and it is very normal. Whenever that happens, they would open a new tab in their browser and type in the related problems with high hopes of answer because they trust in Google whom will be their doctor in finding the answers that they needed.
So, yes, this happened to me too today. I did that exact same pattern hoping to fix my problems. Rows of answers pop up. From StackOverflows, tutorials websites and to personal blogs. Reading through all their answers and tested if it works.
After hours and hours of trying, I am still in the same page. I have not found the answer to my problem because I found out that what I have encountered is very niche. Not many uses this method. This is when my adrenaline started to rise, thinking that if I couldn't solve this problem, it would be the end of my life. With that exaggeration, I stood up and took a short walk, took deep breath and drank a cup of water.
After doing those, I went back on my desk and continue my search for the answers. I changed the method of researching by changing some keywords. Google then return a different result. This is when I found out the solution for my problem. Got very relief at this point.
The reason why I got stuck in the middle of coding is because I wanted to use the shortest and fastest way to achieve my result. Not knowing that by doing this, it will lead to a dead end. Come to think of it, the shortest way isn't always the fastest solution for everything. I should blame myself for not researching for other options before implementing it. It is also good that I came to this issue because without encountering this it, I don't think that I would know about the limitation of using the shortest route.