10 Simple ways to reduce and prevent bugs in your software

Taken from this StackOverflow comment:

  1. Thinking before coding
  2. Fixing bugs or potential for bugs as soon as I see one (not leave it for tomorrow)
  3. Test each little piece of functionality that makes sense on its own
  4. Have it as principle to avoid quick hacks
  5. Use defensive programming techniques everywhere where possible (immutable objects, read-only properties, type constraints etc.)
  6. Write self-explanatory code and comments where code may seem not easy to understand
  7. Avoid sophisticated expressions that require a very fresh state of mind to comprehend
  8. Avoid dense blurbs of code, better make it more verbose to avoid misunderstanding (not saving a few characters on code block brackets helps greatly)
  9. Avoid duplication of code. It will be later next to impossible to trace all instances.
  10. Avoid magic constants in code. Even if you’re 200% sure you’ll only need it in one place, extract it to a constant. Will do you good.

Published by:


Production Facilitator at Audacious Church Previously Software Developer at UKFast Ltd. and Web Applications Developer at SenseLogix Ltd. Graduate of Renewable Energy BSc from the University of Exeter. Experience with PHP, MySQL, Javascript, CSS and HTML.

Categories ProgrammingLeave a comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s