T
5

I used to think you had to memorize EVERYTHING in coding. Then my first project in Python crashed because I forgot a colon.

I was working on a simple script to organize my photos in my Downloads folder last month. Spent like 2 hours writing it, felt super smart. Ran it and got a 'SyntaxError' on line 15. I stared at it for 20 minutes. It was just a missing colon after an 'if' statement. My friend Sam, who's been coding for a year, looked over my shoulder and pointed it out in 2 seconds. He said 'Dude, the computer will tell you what's wrong 90% of the time, you just have to read the error message.' I was trying to remember all the rules instead of just letting the code talk to me. Now I actually READ the red text in the terminal first. What's the most helpful error message you've gotten from a simple mistake?
3 comments

Log in to join the discussion

Log In
3 Comments
skylerc86
skylerc861mo agoTop Commenter
Totally get that feeling of staring at code forever. I once spent an hour debugging a loop because I used a single equals sign instead of double in a condition. The error message literally said "invalid syntax" and pointed right at it, but I kept looking everywhere else. Now I force myself to read the error line first, even if I'm sure it's something more complicated. It saves so much time just letting the computer tell you where to look.
2
nathan851
nathan85113d ago
That rubber duck trick sagesingh mentioned works for everything, not just code.
8
sagesingh
sagesingh1mo ago
Forget the error line, I've started reading error messages out loud like I'm explaining them to a rubber duck. Saying "invalid syntax on line 47" makes my brain actually process the words instead of just seeing them. It feels silly but it forces you to slow down and listen to what the computer is yelling at you. That single equals mistake is a classic because your brain autocorrects it when you scan the code.
1