Friday, November 6, 2015

Stop Writing Bugs

Recently I watched Douglas Crockford's New Developer's Conference 2014 talk. (Is there a more up-to-date version out there?)

It reminded me of something: most of the great programmers I've admired over the years were the ones that seemed obsessed with not writing bugs. Crockford's talk starts with the motivation for JSLint (I run all my JS code through this great tool)... help the world avoid bugs.

It seems like such a basic tenet but many programmers and even more managers/owners don't seem to value this hygiene factor enough.

Many of the other principles I strive to work by are inextricably linked to bug avoidance:

* DRY:  Needless duplication and redundancy increases the chances of writing a bug
* KIS: Simple, elegant designs lead to fewer (or at least easier to find) bugs
* Only build what you need: If you focus on minimum viable products, minimum viable implementations, etc., you are much less likely to add bugs.
* Test oriented/driven development: As a last resort, most of us also need a thorough test harness and coverage to help us avoid writing bugs.

(On a side note, I was inspired by Crockford's talk to try writing some JS without using "this" -- I updated the http://sbrew.com/puzzle page to avoid "this" and use the object creation technique Crockford described).


No comments: