Why You Should Always Read The Error Message First
Why You Should Always Read The Error Message First
Okay so, error messages are scary. Maybe not for a dev who's been at it for years but I started recently enough to remember the newness of it all. The bright red text with loads of numbers and characters that mean nothing. Well actually it's so easy. I just wish that it had been described better to me in the beginning. For example, take the word "Traceback". A traceback is literally the helpful text that gets returned when there is an error. But not knowing that my autistic brain just panicked and zoned it out and got thrown by it and ignored it and then struggled to read the rest of the message. EPIC ERROR and mistake No. #1.
Mistake number 2 is thinking that the error message is scary. Or indeed that you have done something wrong - but as Codecademy told me back in the day. Error messages are a good thing. They are helpful. They are a sign that you are getting something done. If you were getting nothing done, then there would be no error messages! So the error message is trying to tell you where the error is at and what the error is caused by.
Sometimes you have to guess a bit - sometimes an error on a line can mean there is actually an error on the previous line of code which can be a few lines above if there are spaces.
But the error message is always, always trying to help you - and in fact my boss put it so beautifully:
"ALWAYS READ THE ERROR.
BECAUSE IT IS TRYING TO TELL YOU WHAT TO DO."
Always read the error. Because it is trying to tell you what to do.
Always read the error. Because it is trying to tell you what to do.
Thank you
Comments
Post a Comment