I got buy in to change to vanilla Google style guide, with the condition that I set up clang-format to convert the existing code as much as possible over, and ideally also set it up to run as a git hook or something similar.
The benefits of this approach are:
- less reading / information to keep in mind for contributors
- single easy reference and 3rd party authority during pull requests
- a widely-used industry standard that more people would likely be used to (vs our custom ideas about style)
- an automated formatting tool (which I’ve had in the past with Go’s gofmt and been very impressed. I think this is huge).
The idea is to pick some relatively quiet point in time to convert the entire repo over, because many people think we couldn’t switch coding standards without changing all of the existing code to mostly follow those standards (as much as we can in an automated way, anyway).
Bob brought up one worry, which is that right now Stan doesn’t do any name translation between the Stan language and math repo functions, whose names would likely be changed by clang-format.
I don’t think I’ll get to this soon, unless I start using it to procrastinate on other more important stuff I have going on.