I can’t solve problems, what should I do?

Can you all relate to the above image either while solving tough problems on LeetCode, GeeksforGeeks, some other websites, or working with projects?
Yes, we all are the same and it’s the most common doubt among beginners or say codenewbie. I can relate…


This content originally appeared on DEV Community and was authored by Adarsh Navneet Sinha

Can you all relate to the above image either while solving tough problems on LeetCode, GeeksforGeeks, some other websites, or working with projects?
Yes, we all are the same and it's the most common doubt among beginners or say codenewbie. I can relate to it and believe me or not it's becomes so demotivating to continue with same. When I was a beginner, thoughts often came to my mind that this programming sort of thing is not made for me, and thought of giving up.
Frustrated and demotivated

After reading so many articles over the internet, I learned the correct way of learning and improving my productivity. Did I give up?
No, remember the most important rule of being a programmer:
Never Give Up
Curious to know what to do in such conditions? Stay in the loop and I will help you with that.
These tips will be useful regardless of whether you are doing development or problem-solving.
But there is a famous rule in programming that says “never copy-paste code that you don’t understand”.
Confused
Confused? I am saying to break into someone's code but never copy them.
Well, you have there are few steps that you have to follow.
First try to understand the logic from it and try to code by yourself, if you can't then follow the below steps.

  1. Type the complete code by looking through it. (yes, yes, I know I just said not to do copy paste and now this, patience, patience).
  2. Make sure that your program or application is functioning as expected, i.e. confirm that block of code really did solve your problem.
  3. Delete the copy and pasted block of code line by line.
  4. Each time you delete a line, check to see what’s been broken. Does the app still run? What are the error codes? What has deleting that line of code done to your program?
  5. Even if you think you know what a line of code does, delete it any way. The most important task as a programmer is to always test your assumptions against the outcome. The most enjoyable feeling as a programmer is for the real world to validate your assumptions. You know how nice it is when your boyfriend/girlfriend/husband/wife says those magical three words. AC 0 Errors or All Testcases Passed or AC or I was right. It’s like that, but better.

By breaking the solution code, line-by-line, you’ll learn and understand what each line does and why it’s been written. This is a far better way to use code from other people than just pasting it in and hoping for the best. Once you understand why each of those lines was necessary, the next time you encounter a similar problem, you’ll be able to tease out the problem and solve it yourself.

You might now probably ask, ok I will follow these tips but how will I know if I have improved or not? What's my progress.

Well for that what you need is to bookmark the question or note down where your code was failing. Once you have took help from any source, come back after some time let's say 2-3 weeks and try to code now by yourself. Still can't? Continue this loop until you can solve without looking to solution.
Confident

Feeling confident and motivated now?

Yes, All the very best for your journey.
No? Feel free to reach out to me at my social handles @geeky01adarsh

Let me know your thoughts in the comment box below.
Keep Coding!


This content originally appeared on DEV Community and was authored by Adarsh Navneet Sinha


Print Share Comment Cite Upload Translate Updates
APA

Adarsh Navneet Sinha | Sciencx (2021-08-31T07:56:59+00:00) I can’t solve problems, what should I do?. Retrieved from https://www.scien.cx/2021/08/31/i-cant-solve-problems-what-should-i-do/

MLA
" » I can’t solve problems, what should I do?." Adarsh Navneet Sinha | Sciencx - Tuesday August 31, 2021, https://www.scien.cx/2021/08/31/i-cant-solve-problems-what-should-i-do/
HARVARD
Adarsh Navneet Sinha | Sciencx Tuesday August 31, 2021 » I can’t solve problems, what should I do?., viewed ,<https://www.scien.cx/2021/08/31/i-cant-solve-problems-what-should-i-do/>
VANCOUVER
Adarsh Navneet Sinha | Sciencx - » I can’t solve problems, what should I do?. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/08/31/i-cant-solve-problems-what-should-i-do/
CHICAGO
" » I can’t solve problems, what should I do?." Adarsh Navneet Sinha | Sciencx - Accessed . https://www.scien.cx/2021/08/31/i-cant-solve-problems-what-should-i-do/
IEEE
" » I can’t solve problems, what should I do?." Adarsh Navneet Sinha | Sciencx [Online]. Available: https://www.scien.cx/2021/08/31/i-cant-solve-problems-what-should-i-do/. [Accessed: ]
rf:citation
» I can’t solve problems, what should I do? | Adarsh Navneet Sinha | Sciencx | https://www.scien.cx/2021/08/31/i-cant-solve-problems-what-should-i-do/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.