3 ms·
A code base is a living document, and it changes as it grows and responds to new requirements, or is patched or refactored to fix old bugs. The git log is a hi
by rjknight 13y ago
A code base is a living document, and it changes as it grows and responds to new requirements, or is patched or refactored to fix old bugs. The git log is a history of everything that happened to that code base over its lifetime to date. If that log is full of people committing small style changes because they don't agree with the last guy's position on semi-colons or the use of array literals or how many characters to indent by, then I'd argue that it's actually a less meaningful work. If you're looking for beauty, elegance and meaning in the code, you'll find it in the clear expression of intent that you get when the changes are about function rather than form. Where's the beauty in a "Fixed indenting" commit? What does it tell you other than that someone ran their editor's auto-indenting routine?
Adherence to a common style keeps such noise to a minimum, leaving you with a commit history that's full of meaningful changes rather than meaningless thrashing over whether to indent four characters or two, or whether the { goes on the same line as the if (...).
- threeseed 13y agoCoding styles can often be enforced through automated means before checkin. And even if they can't it is trivial to flatten commits to make style changes disappear. The point of style guides are to leverage best practices and ensure anyone can easily read, understand and modify your code.