{"id":629,"date":"2021-11-17T12:42:27","date_gmt":"2021-11-17T19:42:27","guid":{"rendered":"https:\/\/redmonk.com\/rstephens\/?p=629"},"modified":"2021-12-17T13:06:42","modified_gmt":"2021-12-17T20:06:42","slug":"code-reuse","status":"publish","type":"post","link":"https:\/\/redmonk.com\/rstephens\/2021\/11\/17\/code-reuse\/","title":{"rendered":"Easy to Reuse Code vs. Code Designed for Reuse"},"content":{"rendered":"<p>I was reading the \u201cWriting and Shipping Code Faster\u201d section of the <a href=\"https:\/\/octoverse.github.com\/writing-code-faster\/\">2021 State of the Octoverse<\/a>. The report includes <a href=\"https:\/\/octoverse.github.com\/writing-code-faster\/#improving-developer-productivity\">a diagram<\/a> that indicates predictive relationships between software development practices and their impact (both positive and negative) on the organization\u2019s ability to deliver code.<\/p>\n<p>One thing that caught my eye is that in the \u201cwork\u201d context (as opposed to the study&#8217;s separate findings about open source communities), the practice of \u201ceasy to reuse code\u201d was positively correlated with the perception of being \u201cempowered to work.\u201d However, \u201ccode designed for reuse\u201d had a negative relationship with empowerment.<\/p>\n<p>The difference between reusing code vs. designing code for reuse felt worthy of reflection, so I dug into <a href=\"https:\/\/github.com\/PreciselyAlyss\/2021octoverse-survey\/blob\/main\/writing-and-shipping-code-items.md\">the survey questions<\/a>. For each question respondents could choose between Never, Rarely, Sometimes, Often, and Always. The questions for each concept were as follows:<\/p>\n<blockquote><p>\n  <strong>Easy to Reuse Code<\/strong><\/p>\n<ul>\n<li>I would like to use or continue to use code or libraries from outside my team or repository<\/li>\n<li>I currently use code or libraries from outside my team or repository<\/li>\n<\/ul>\n<p>  <strong>Code Designed for Reuse<\/strong><\/p>\n<ul>\n<li>Accept pull requests from people outside the project or team<\/li>\n<li>Respond to pull requests or issues from people outside the project or team quickly<\/li>\n<li>Describe whether the code will be supported in the future<\/li>\n<li>Design documentation to make dependencies clear<\/li>\n<li>Write comments that describe how each part of the code work<\/li>\n<li>Modularize code so that people can reuse individual<\/li>\n<\/ul>\n<\/blockquote>\n<p>In short, it appears respondents are interested in the efficiencies of reusing other people\u2019s well-documented, well-supported code but feel less productive and empowered when doing the work to make their own code similarly reusable for others.<\/p>\n<p>All of which is the say, the distinction between easy to reuse code and designing code for reuse reminds me of <a href=\"https:\/\/www.theonion.com\/report-98-percent-of-u-s-commuters-favor-public-trans-1819565837\">my all time favorite Onion headline<\/a>.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/redmonk.com\/rstephens\/files\/2021\/11\/Onion-Headline.png\" alt=\"Report: 98 Percent Of U.S. Commuters Favor Public Transportation For Others\" width=\"1676\" height=\"420\" class=\"aligncenter size-full wp-image-630\" srcset=\"https:\/\/redmonk.com\/rstephens\/files\/2021\/11\/Onion-Headline.png 1676w, https:\/\/redmonk.com\/rstephens\/files\/2021\/11\/Onion-Headline-520x130.png 520w, https:\/\/redmonk.com\/rstephens\/files\/2021\/11\/Onion-Headline-1024x257.png 1024w, https:\/\/redmonk.com\/rstephens\/files\/2021\/11\/Onion-Headline-768x192.png 768w, https:\/\/redmonk.com\/rstephens\/files\/2021\/11\/Onion-Headline-1536x385.png 1536w, https:\/\/redmonk.com\/rstephens\/files\/2021\/11\/Onion-Headline-480x120.png 480w, https:\/\/redmonk.com\/rstephens\/files\/2021\/11\/Onion-Headline-1200x301.png 1200w\" sizes=\"auto, (max-width: 1676px) 100vw, 1676px\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I was reading the \u201cWriting and Shipping Code Faster\u201d section of the 2021 State of the Octoverse. The report includes a diagram that indicates predictive relationships between software development practices and their impact (both positive and negative) on the organization\u2019s ability to deliver code. One thing that caught my eye is that in the \u201cwork\u201d<\/p>\n","protected":false},"author":45,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","footnotes":"","jetpack_publicize_message":"Quickly exploring one piece of the 2021 State of the Octoverse report: Easy to Reuse Code vs. Code Designed for Reuse","jetpack_is_tweetstorm":false},"categories":[73,47],"tags":[],"class_list":["post-629","post","type-post","status-publish","format-standard","hentry","category-devops","category-github"],"jetpack_featured_media_url":"","jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/redmonk.com\/rstephens\/wp-json\/wp\/v2\/posts\/629","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/redmonk.com\/rstephens\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/redmonk.com\/rstephens\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/redmonk.com\/rstephens\/wp-json\/wp\/v2\/users\/45"}],"replies":[{"embeddable":true,"href":"https:\/\/redmonk.com\/rstephens\/wp-json\/wp\/v2\/comments?post=629"}],"version-history":[{"count":0,"href":"https:\/\/redmonk.com\/rstephens\/wp-json\/wp\/v2\/posts\/629\/revisions"}],"wp:attachment":[{"href":"https:\/\/redmonk.com\/rstephens\/wp-json\/wp\/v2\/media?parent=629"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/redmonk.com\/rstephens\/wp-json\/wp\/v2\/categories?post=629"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/redmonk.com\/rstephens\/wp-json\/wp\/v2\/tags?post=629"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}