What's the easiest programming bug you’ve spent way too much time trying to solve? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

What's the easiest programming bug you’ve spent way too much time trying to solve?

23rd Nov 2017, 1:28 PM
Md. Asiful Hoque Prodhan
Md. Asiful Hoque Prodhan - avatar
5 Answers
+ 14
Once I wrote the code for an Android app. At one place in hundreds of lines of code, I wrote "EditText" instead of "TextView" (IDE won't recognize this error). It took me 4 hours to write the code but 1 whole day to find the mistake.
23rd Nov 2017, 4:42 PM
Krishna Teja Yeluripati
Krishna Teja Yeluripati - avatar
+ 4
I forgot to put a cout statement and was thinking for like 2 days why the hell is this not giving me any output..... 😂😂😂😂😂 https://www.sololearn.com/Discuss/728061/?ref=app
23rd Nov 2017, 5:48 PM
Saurabh Tiwari
Saurabh Tiwari - avatar
+ 3
yea i will sound dumb if i explain it so i have a class that manages config files which handles currently 2 main files. i have copy pasted code and i messed something up. this is what the code looked like about ConfigManager manager = new ConfigManager(); manager.setupFile1(); manager.loadFile1(); ConfigManager manager = new ConfigManager(); manager.setupFile2(); manager.loadFile2(); then runningc this gave me a NullpointerException on file1 for guess what reason. i accidentally did ConfigManager manager = new ConfigManager(); twice which overrides file1 to null it took me 45 min to figure it out because i was only looking in the ConfigManager class. i did fix a few other bugs in the process but now i hate myself for not thinking to read the object creation. something to learn... if you have a problem, do not only read the area where the stacktrace tells you where it is, but also how it was constructed and declared happy coding
23rd Nov 2017, 2:55 PM
SomeoneAwesome78
SomeoneAwesome78 - avatar
+ 3
I was coding on Unity and wrote the code that checks whether the LayerMask is ground , if so player can jump ... nothing fancy But the code didn't work , it took me an entire day , changing every line of code which I knew was right (just in case ) changing mechanics , doing every stupid thing I can , I was about to delete the game then I noticed I set the Tag as "Ground" instead of LayerMask (they are next to each other) ;_;
23rd Nov 2017, 5:24 PM
Utkαrsh
Utkαrsh - avatar
+ 1
When I was writing a game in Python I used an integer type input and couldn't figure out why the whole game broke. I changed everything and still no luck, spent 2 days on it. Then I realised I just had to remove the integer from int(input()). That solved everything.
24th Nov 2017, 12:41 AM
Tadreik Campbell
Tadreik Campbell - avatar