{"id":20,"date":"2025-01-17T07:05:49","date_gmt":"2025-01-17T07:05:49","guid":{"rendered":"https:\/\/blogs.oregonstate.edu\/paradeis\/?p=20"},"modified":"2025-01-17T07:05:49","modified_gmt":"2025-01-17T07:05:49","slug":"smelly-code-smelly-code","status":"publish","type":"post","link":"https:\/\/blogs.oregonstate.edu\/paradeis\/2025\/01\/17\/smelly-code-smelly-code\/","title":{"rendered":"Smelly Code, Smelly Code"},"content":{"rendered":"\n<p>I always appreciate when the subject matter I&#8217;m studying goes beyond the strict boundaries of whatever is most functional and immediate. Writing clean code is one of those things that is often overlooked and undervalued. We&#8217;ve discussed it at length in several of my classes at OSU, and I still find myself having to slow down and consciously consider ways that I can improve the readability and cohesion of my code.<\/p>\n\n\n\n<p>I am the first to admit that I&#8217;m not great at commenting my code, and that I tend to do most of my commenting as an afterthought. I think that comes from underestimating my ability (or overestimating everyone else&#8217;s). There&#8217;s a part of me that struggles to define what might be considered complex or not intuitive, and I think a lot of that comes from assuming that I struggle more (as a baby developer) than any potential readers. I&#8217;m working on being more intentional about comments, which is advice I&#8217;ve come across through a multitude of sources.<\/p>\n\n\n\n<p>That being said, I do make a concentrated effort to be concise when I code. I am generally good at consistency and clarity in variable naming, and I&#8217;m mindful of redundancy in code and strive to separate things into more modular sub-functions. <\/p>\n\n\n\n<p>One thing I&#8217;m actively working on phasing out is a tendency to hold on to outdated code that I&#8217;ve commented out. I have a silly fear about deleting a block of code and then finding out hours or days later that my previous solution was more effective. I&#8217;m not egregious about this, and usually I remember to delete the section once I&#8217;m done actively working on that part of the project. But sometimes things get left behind, and I&#8217;m striving to be more mindful of this tendency.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"840\" height=\"617\" src=\"https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/8200\/files\/2025\/01\/image.png\" alt=\"\" class=\"wp-image-21\" srcset=\"https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/8200\/files\/2025\/01\/image.png 840w, https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/8200\/files\/2025\/01\/image-300x220.png 300w, https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/8200\/files\/2025\/01\/image-768x564.png 768w\" sizes=\"auto, (max-width: 840px) 100vw, 840px\" \/><figcaption class=\"wp-element-caption\">Section from Lara Letaw&#8217;s <em>Handbook of Software Engineering<\/em> <em>Methods<\/em> regarding comments and code smells<\/figcaption><\/figure>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I always appreciate when the subject matter I&#8217;m studying goes beyond the strict boundaries of whatever is most functional and immediate. Writing clean code is one of those things that is often overlooked and undervalued. We&#8217;ve discussed it at length in several of my classes at OSU, and I still find myself having to slow [&hellip;]<\/p>\n","protected":false},"author":14589,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-20","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blogs.oregonstate.edu\/paradeis\/wp-json\/wp\/v2\/posts\/20","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.oregonstate.edu\/paradeis\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.oregonstate.edu\/paradeis\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/paradeis\/wp-json\/wp\/v2\/users\/14589"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/paradeis\/wp-json\/wp\/v2\/comments?post=20"}],"version-history":[{"count":1,"href":"https:\/\/blogs.oregonstate.edu\/paradeis\/wp-json\/wp\/v2\/posts\/20\/revisions"}],"predecessor-version":[{"id":22,"href":"https:\/\/blogs.oregonstate.edu\/paradeis\/wp-json\/wp\/v2\/posts\/20\/revisions\/22"}],"wp:attachment":[{"href":"https:\/\/blogs.oregonstate.edu\/paradeis\/wp-json\/wp\/v2\/media?parent=20"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/paradeis\/wp-json\/wp\/v2\/categories?post=20"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/paradeis\/wp-json\/wp\/v2\/tags?post=20"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}