{"id":12452,"date":"2024-09-17T12:07:47","date_gmt":"2024-09-17T16:07:47","guid":{"rendered":"https:\/\/irreal.org\/blog\/?p=12452"},"modified":"2024-09-17T12:07:47","modified_gmt":"2024-09-17T16:07:47","slug":"word-diff-counter","status":"publish","type":"post","link":"https:\/\/irreal.org\/blog\/?p=12452","title":{"rendered":"Word Diff Counter"},"content":{"rendered":"<p>\nChris Maiorana has <a href=\"https:\/\/chrismaiorana.com\/word-diff-counter\/\">an interesting take on counting words<\/a>. He&rsquo;s a writer and like all writers, he&rsquo;s interested in how many words he&rsquo;s written in the current session. His reasons for wanting that count boils down to it providing a measure of his daily work and, perhaps more important, helping him to know when to stop.\n<\/p>\n<p>\nBut, he says, there are some problems with word counts as usually implemented.  The most important concerns the way that many (the majority of?) writers work. They like to reread and edit what they wrote in their last session. That means that words may be subtracted as well as added. What&rsquo;s really needed, he says, is a count of the number of words that have changed.\n<\/p>\n<p>\nHis solution for that is to use <code>git diff<\/code> to find out how the text has changed and count the number of changes. It&rsquo;s a bit fussy as you&rsquo;d imagine but really pretty straightforward. Take a look at his blog post for the code and details.\n<\/p>\n<p>\nI love this idea but I&rsquo;m not sure it&rsquo;s for me. For long form writing, what I&rsquo;m mainly interested in is progress so knowing my current word count\u2014regardless of additions or subtractions\u2014is what&rsquo;s important to me. For short form writing, such as this blog, I really care only about the total word count since I almost always complete a post in a single session\u2014not counting a final editing pass just before I publish it\u2014and I&rsquo;m never in any danger of burning out while writing a single post.\n<\/p>\n<p>\nStill, if you&rsquo;re a writer and interested in measuring your work rather than your progress, Maiorana&rsquo;s hack may be just what you&rsquo;re looking for. You&rsquo;ll need to keep your text in Git but you should be doing that anyway.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Chris Maiorana has an interesting take on counting words. He&rsquo;s a writer and like all writers, he&rsquo;s interested in how many words he&rsquo;s written in the current session. His reasons for wanting that count boils down to it providing a &hellip; <a href=\"https:\/\/irreal.org\/blog\/?p=12452\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[18],"class_list":["post-12452","post","type-post","status-publish","format-standard","hentry","category-general","tag-emacs"],"_links":{"self":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/12452","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=12452"}],"version-history":[{"count":1,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/12452\/revisions"}],"predecessor-version":[{"id":12453,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/12452\/revisions\/12453"}],"wp:attachment":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=12452"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=12452"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=12452"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}