{"id":18,"date":"2023-01-27T02:37:28","date_gmt":"2023-01-27T02:37:28","guid":{"rendered":"https:\/\/blogs.oregonstate.edu\/lifechallenge\/?p=18"},"modified":"2023-01-27T02:37:28","modified_gmt":"2023-01-27T02:37:28","slug":"clean-code","status":"publish","type":"post","link":"https:\/\/blogs.oregonstate.edu\/lifechallenge\/2023\/01\/27\/clean-code\/","title":{"rendered":"Clean Code"},"content":{"rendered":"\n<p>I ended up reading through 2 articles concerning &#8220;clean code&#8221; practices and both of them have given me some insight one what I should try to do more often, and what I should avoid doing in the future. First off, from the article <a rel=\"noreferrer noopener\" href=\"https:\/\/x-team.com\/blog\/principles-clean-code\/\" target=\"_blank\">A Few Principles of Clean Code<\/a>, it brings up the idea of practicing consistency. The idea of it is that if you decide to do something in a certain way, you should stick to it throughout the entire project. This is something I hope to do more of in the future, as occasionally I will not be consistent and then later on down the road I find that my code is difficult to understand because of it. It&#8217;s a simple change that can make a huge difference. <\/p>\n\n\n\n<p>The second article I read was <a rel=\"noreferrer noopener\" href=\"https:\/\/www.ionos.com\/digitalguide\/websites\/web-development\/clean-code-principles-advantages-and-examples\/\" target=\"_blank\">Clean Code: What Makes Programming Code Clean<\/a> to which one thing they talked about was &#8220;readability over conciseness&#8221;. This basically means that when for example, you are naming a variable, the readability of the code is more important than its conciseness. This would mean that the name for the variable you are making should be self-describing so that anyone looking at your code can understand what the variable is used for. So instead of naming a variable <strong>int t;<\/strong> which doesn&#8217;t give you any information on what it represents, you could name it <strong>int elapsedTimeInDays;<\/strong>. Now I normally don&#8217;t name variables as bad as in the example, but there is always some room for improvement so my goal for the future is to avoid naming my variables in non-descriptive ways. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>I ended up reading through 2 articles concerning &#8220;clean code&#8221; practices and both of them have given me some insight one what I should try to do more often, and what I should avoid doing in the future. First off, from the article A Few Principles of Clean Code, it brings up the idea of [&hellip;]<\/p>\n","protected":false},"author":12994,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-18","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blogs.oregonstate.edu\/lifechallenge\/wp-json\/wp\/v2\/posts\/18","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.oregonstate.edu\/lifechallenge\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.oregonstate.edu\/lifechallenge\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/lifechallenge\/wp-json\/wp\/v2\/users\/12994"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/lifechallenge\/wp-json\/wp\/v2\/comments?post=18"}],"version-history":[{"count":1,"href":"https:\/\/blogs.oregonstate.edu\/lifechallenge\/wp-json\/wp\/v2\/posts\/18\/revisions"}],"predecessor-version":[{"id":19,"href":"https:\/\/blogs.oregonstate.edu\/lifechallenge\/wp-json\/wp\/v2\/posts\/18\/revisions\/19"}],"wp:attachment":[{"href":"https:\/\/blogs.oregonstate.edu\/lifechallenge\/wp-json\/wp\/v2\/media?parent=18"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/lifechallenge\/wp-json\/wp\/v2\/categories?post=18"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/lifechallenge\/wp-json\/wp\/v2\/tags?post=18"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}