News for hackers. Stuff that matters.
Re:Literate programming: Knuth is doing it wrong (2014) by fsmv on Monday January 13, 2025 @11:39AM (#42685347)
If you wrote better commit messages you might look at them more because they're a lot more useful.

At work I see it as explaining why the code is there so when people check the blame layer they can find out and not delete my code if my reason is still relevant.

At home it helps a lot to write changelogs later when I do a release and it helps so much to see the last few commits when I pick a project up again after a month or two.

Re:Literate programming: Knuth is doing it wrong (2014) by hitchstory on Monday January 13, 2025 @11:47AM (#42685460)
I mostly just message the person who wrote it if I have questions when I look at a commit and have questions.

I suppose if I painstakingly write 1000 beautiful commit messages I could save myself from having that one conversation when somebody else has a question about one of those commits.

Re:Literate programming: Knuth is doing it wrong (2014) by moe_sc on Monday January 13, 2025 @12:01PM (#42685640)
That doesn't sound future proof.

People leave projects/companies, people forget.

Code comments are also far from good. They have the same issue as duplicatet code. Comment and code age indiviually. Now you have to maintain both and it's for them to diverge.

Git commits are a snapshot of the codebase. Commit messages in them are pinned to a code version. Comments in commit messages are therefore always tied to the right version of code.

Re:Literate programming: Knuth is doing it wrong (2014) by hitchstory on Monday January 13, 2025 @12:10PM (#42685766)
People leaving is a great reason to write literate tests and other kinds of docs - the kind people actually look for and want to read.

If somebody asks a question that can only be asked by looking in a commit message that usually represents a failure in one of those docs.

Re:Literate programming: Knuth is doing it wrong (2014) by kccqzy on Monday January 13, 2025 @03:24PM (#42688619)
I'm an introvert. I don't want anyone to message me (or worse, set up a meeting with me) just to understand what my commit does.

Furthermore writing is itself a way to enhance clarity of thinking. Very often during the process of writing out a commit message I realize something else in the commit is missing.