Good practices (Arduino Programming)

  1. Be consistent in your formatting and naming conventions.
  2. Follow the local standard, if any. (In the case of Arduino, format your code the same way that auto-format would format it.)

I think here in the arduino forums, we often fail to stress the importance of breaking up your program into appropriately sized functions, and frequently have loop() with WAY too much code in it...

Be aware of performance issues. Things like Strings, and 64bit math, operator overloading, and calls to elegant libraries, may look simple and clean, but they can't actually magically perform better than more complicated combinations of simpler functions. On the other hand, don't be paranoid about performance, either. "Fast enough" is in fact fast enough, and "if it doesn't matter, it doesn't matter."