[sdiy] Resources on embedded programming good practices?

Neil Johnson neil.johnson71 at gmail.com
Tue Apr 21 16:55:37 CEST 2020


Spiros Makris wrote:
> I  want to improve my coding habits so that my results will stay maintainable and easy to mod/reuse in the future.
> I don't have the opportunity to work alongside an experienced colleague to learn how I should write my code to be up to "industry standards"
> I would appreciate any suggestions on online resources or books.

Some suggestions:

1/ Coding style:

2/ Auto-generate documentation:

The point of #2 is to force you to write documented code.

And lots of reading.  I can recommend a few books, there are many others...
Safer C, by Les Hatton
The Practice of Programming (ISBN 0-201-61586-X) by Brian W. Kernighan
and Rob Pike
A Retargetable C Compiler: Design and Implementation by Hanson and Fraser

To get an idea of how the "really big" boys do it:
Although I don't propose you adopt that standard!  Just a taste of the
bigger picture.

Also, remember that the very last thing you do is write code.  Code is
just the embodiment of a good design.  Without a design, you're just
typing.  When I wrote miby I spent a long time getting the flowchart
right, working through the MIDI spec trying to make sure I covered all
the cases, and ran through many scenarios.  I'm sure there are still
bugs in it (I'm not as brave as Don Knuth!) but hopefully the bugs
that are there are implementation bugs and not design bugs.


More information about the Synth-diy mailing list