Monday, October 24, 2016

How to be free of bugs?

"A bug is never just a mistake. It represents something bigger. An error of thinking. That makes you who you are." ~Mr. Robot

How to eliminate bugs in code?
Be clearer in your thinking when writing code.

How to be clearer in thinking? 
Think through the Requirements and Design thoroughly BEFORE even starting to code.

According to research, changes in requirements during Design Phase is 5-10x more costly than if the changes were done in Requirements Phase. Changes in requirements during Coding Phase are 10-100x more costly!

See the Big Picture. 
Differentiate what contribute to the main goal and what doesn't. Eliminate clutter and distractions with extreme prejudice.

Learn the concept of "Encapsulation", and how to apply it in code (and outside code).

Don't write large chunks of code. Research shows that the smaller the class or method, the more bug-free it is. Why? There is a limit to human focus / mental cache / mental energy. Human simply cannot focus on a lot of things at one time.

No comments:

Post a Comment