Who else freaks out when they code and cannot find why the program doesnt work😪😪 | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Who else freaks out when they code and cannot find why the program doesnt work😪😪

no pain no gain🏆

5th Jan 2018, 9:44 PM
Alejandro López Vega
Alejandro López Vega - avatar
7 Answers
+ 5
Given the lack of debugger available for SoloLearn code, my trick is lots of output lines. Displaying status as the program runs lets you know where it fails. Seeing values of your variables points out problems quickly. You can limit the output by counting how many times you get to the area and outputting every 20 or other number that makes sense. In 15 minutes, I've found a bug that occurred on the 56 call to a function using this technique and displaying the local variables only for the call to see the problem.
6th Jan 2018, 12:19 AM
John Wells
John Wells - avatar
+ 8
compiler and debbuger are very helpful in that situation 😁
5th Jan 2018, 9:52 PM
Vukan
Vukan - avatar
+ 5
u have to take rest and back to code and then u can see where is the problem it's happen
5th Jan 2018, 10:04 PM
Mohamed Bardouni
Mohamed Bardouni - avatar
+ 4
Definitely agree with taking a break. It always seems to work when you approach it with a fresh perspective. Also, debugging with breakpoints is a great way to hone in on that pesky problem.
5th Jan 2018, 10:46 PM
Bagshot
Bagshot - avatar
+ 3
Walk away take a walk outside do other things hell even sleep on it. Give your mind a break to collect your thoughts also make sure your hydrated and patient.
6th Jan 2018, 1:13 AM
Anthony Perez
+ 1
I clear my head for a few minutes , then I do it the old fashioned way. I use a series of print statements on variables that I suspect are not working. That way I can see what is taking place with the variables. I can see the output of the suspected variables. If that doesn't work I take a break for a few hours , then look at the program from a fresh perspective. If nothing else works then I go do a Google search to see if there is a similar problem solved.
6th Jan 2018, 1:22 AM
Rick Zalman
+ 1
thank you everybody, love the advice❤
8th Jan 2018, 9:16 PM
Alejandro López Vega
Alejandro López Vega - avatar