I described the genesis of my source code library in a recent post. While poring over old code, I noticed that my formatting had been inconsistent across projects, and so I decided to adopt a unified coding style for future projects. I found a palatable style guide from the Software Engineering Laboratory (SEL), which I intend to adopt with two small changes:
- The guide defines function names by capitalising the first letter of each word, but throughout the guide they use lower case words separated by underscores. To resolve this inconsistency, I’ll use the latter.
- They use a line of asterisks for box comments and section separators. I find that garish, so I’ll use equal signs and hyphens, respectively.
I don’t know that adopting a particular style has any tangible benefits, but consistency might eventually prove valuable.