I went through a phase a few years ago of writing ESSAYS in my commit messages, on the basis that they were the only form of documentation which I trusted to stay 100% synchronized with the code. Eventually I realized that there's a better way to do this: keep your documentation in the same repo as your code, and construct commits that update the documentation AND the tests AND the code all in the same unit. Now your…
Literate Commits (2016)
11–16 of 16 posts
Re: Literate Commits (2016)
#12I went through a phase a few years ago of writing ESSAYS in my commit messages, on the basis that they were the only form of documentation which I trusted to stay 100% synchronized with the code. Eventually I realized that there's a better way to do this: keep your documentation in the same repo as your code, and construct commits that update the documentation AND the tests AND the code all in the same unit. Now your…
Just to bring up a neat point, this doesn't guarantee that the documentation and the code are the same, as you could change code without updating documentation. A very slick way of enforcing this that I've seen is having actual unit tests in your documentation (and of course a CI tool to enforce that tests pass). This is something that I think is extremely cool about Elixir! It forces you to think about testing, docu…
Re: Literate Commits (2016)
#13This seems very sensible, and completely at odds with the common “best practice” of keeping commit messages short. I find that the best way to understand why a piece of code is the way it is is not through comments in the code, but by looking at history and commit messages. They are comments where it’s completely clear what code they describe, even if it’s spread out across the code base, and even if the code has sin…
Commit messages are often small essays. Especially in the Linux kernel
Re: Literate Commits (2016)
#14I went through a phase a few years ago of writing ESSAYS in my commit messages, on the basis that they were the only form of documentation which I trusted to stay 100% synchronized with the code. Eventually I realized that there's a better way to do this: keep your documentation in the same repo as your code, and construct commits that update the documentation AND the tests AND the code all in the same unit. Now your…
Just to bring up a neat point, this doesn't guarantee that the documentation and the code are the same, as you could change code without updating documentation. A very slick way of enforcing this that I've seen is having actual unit tests in your documentation (and of course a CI tool to enforce that tests pass). This is something that I think is extremely cool about Elixir! It forces you to think about testing, docu…
Go goes the opposite direction with “testable examples” that are written alongside test code and added to generated documentation.
https://docs.python.org/2/library/doctest.html
Re: Literate Commits (2016)
#15This seems very sensible, and completely at odds with the common “best practice” of keeping commit messages short. I find that the best way to understand why a piece of code is the way it is is not through comments in the code, but by looking at history and commit messages. They are comments where it’s completely clear what code they describe, even if it’s spread out across the code base, and even if the code has sin…
Commit titles should be short. Commit messages are often small essays. Especially in the Linux kernel
Re: Literate Commits (2016)
#16While I am still working on my pieceful implementation, the hope is to very much elevate the role of the pieces and ideally generate graphs relating to all the pieces that might have code, tests, various documentations related to the pieces, all being woven into their separate compilation targets.