Saturday, 21 July 2012

How not to SMASH your Computer - 5 Tips on Debugging

Every programmer or developer has that problem. Sometimes your code wont run. Other times, the code runs but does not give the intended results. In rare cases, you fix the bug without even knowing how. But do not worry, I will show you some tips to save that hair your going to pull out.

  1. Check everything over. Even the things you don't expect to be wrong. Trust me, you'd be surprised at what you did wrong. If you are following a tutorial, look over the steps and make sure you executed everything correctly.
  2. Check versions and requirements. Maybe you are using the wrong type or version of something. Check all your libraries, plugins, language versions. Make sure everything is compatible.
  3. Revise your code. If the language you are using is case sensitive, make sure you have the correct capital modes.
  4. Use and IDE with a debugger. This can cut the time it takes to debug by half. The IDE will tell you specifically what is wrong. If you want to save time, get one. They are free (most of them).
  5.  Pretend your the compiler. Run through the code and find what each bit does. See if something doesn't make much sense.
That's all for now, I hope this stops a lot of frustration in the future.


No comments:

Post a Comment