Introduction

Code should be written to be readable and not just runnable.

Any code we write at Adafruit is 'read' by a many thousands of people with varying levels of experience with the software and hardware they are working with.

That puts a unique burden on us to produce code that doesn't just 'work', but is also easy to understand and maintain.

In a conscious effort to improve our own code in this area, we've put together this simple guide to writing code that's easier to read, maintain and understand.

While everything suggested here is somewhat personal, and largely a reflection of my own habits working in C over the years, as Adafruit continues to grow as a company we want to put more emphasis on code quality, in the same way we've focused on the quality of our HW designs and tutorials.

We've tried to keep these guidelines as general as possible recognizing that everyone has (and has the right to) their own style, but there are some things we think are worth insisting on in the interest of readability and keeping things accessible for customers.
This guide is a work in progress, and is far from complete. We're publicly documenting our process of setting the standard for new drivers as we grow as a company and bring new people on board to help offer our customers the best possible user experience with reliable HW and documentation as well as reliable, easy to understand drivers.
Last updated on 2015-05-04 at 04.27.56 PM Published on 2014-05-01 at 11.53.52 AM