5 Mistakes you should avoid while coding
Hey there, this post is in collaboration with Sahil Pabale He made a tweet on this, check it out here-
Do you remember, in school, our teacher reminding us to recheck our answer sheet before submitting it?
We rarely used to obey them and then end up making silly mistakes :/
This is the same with Coding too!
1. Test your code regularly
When we're building some big project, our codebase becomes bigger. We write the code and move forward (because there's a lot more to write) and when the time comes to finally test it, the console is filled up with lots of errors and warnings.
2. Keep fixing bugs and comment your code where needed
That's where we do mistakes of not adding proper comments and reading the code from time to time. Also, the errors ain't that perfect to debug, then how do you get out of this?
3. Optimize your code
A lot of libraries or packages don't document the possible errors that would occur while developing! It's up to us to handle them all precisely and make the app optimized enough. When we read our code, again and again, half of the bugs get to sort out :D
4. Using logs to find bugs
After reading the code, make sure to log important data variables to know where the app is being weird. That helps to understand the problems and possible loopholes. After solving the problem, you can remove them from the code!
5. Do proper error handling
There's a concept called Error Management, wherein you are responsible to write code to handle all the possibilities as well as runtime errors for your App. This way your app is responding to the user with proper validations which improves the overall UX :)