{"id":22,"date":"2025-01-16T18:12:39","date_gmt":"2025-01-16T18:12:39","guid":{"rendered":"https:\/\/blogs.oregonstate.edu\/tr3nn\/?p=22"},"modified":"2025-01-16T18:30:19","modified_gmt":"2025-01-16T18:30:19","slug":"later-never","status":"publish","type":"post","link":"https:\/\/blogs.oregonstate.edu\/tr3nn\/2025\/01\/16\/later-never\/","title":{"rendered":"Later = Never"},"content":{"rendered":"\n<p>                                          &#8211; LeBlanc&#8217;s Law<\/p>\n\n\n\n<p>This statement couldn&#8217;t be more true. How many times in life has this been the case?<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>&#8220;It looks okay right now, I think ill come back later to make it look nicer&#8221;  &#8211; Me<\/p>\n<\/blockquote>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>&#8220;I need to go finish this assignment, but ill do it later&#8221;  &#8211; also Me<\/p>\n<\/blockquote>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>I am going to go to the gym later! &#8211; again\u2026 Me <\/p>\n<\/blockquote>\n\n\n\n<p>Now there truly are times when things need to get done &#8220;later&#8221; and they in fact do. So yes, it&#8217;s not like I never get anything done, but my point is that I can get caught up in this exact thing. I can put stuff off because I am either doing something else (hopefully it&#8217;s important) or I am making this age-old excuse &#8220;I&#8217;ll do it later&#8221;.<\/p>\n\n\n\n<p>Now, when it comes to my code, I don&#8217;t want this to be the case. Why not do the heavy lifting now, before the code gets too &#8220;tangled&#8221; or &#8220;messy&#8221;? Deadlines for projects are excuses to just get something just up and running, they are an opportunity to present your best work.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>&#8221; Most managers want the truth, even when they don&#8217;t act like it. Most managers want good code, even when they are obsessing about the schedule. They may defend the schedule and requirements with passion; but that&#8217;s their job. It&#8217;s your job to defend the code with equal passion<\/p>\n\n\n\n<p>&#8211; Robert Martin, <strong>Clean Code: A Handbook of Agile Software Craftsmanship<\/strong><\/p>\n<\/blockquote>\n\n\n\n<p>I want to take the <strong>time,<\/strong> early and often, to write code that is both &#8220;elegant&#8221; and &#8220;efficient&#8221; as Bjarne Stroustrup, the inventor of C++, would say. This is done by being disciplined, using little techniques that help with both cleanliness and code-sense. It takes practice to take this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong><mark class=\"has-inline-color has-paddletail-black-color\">def calc(x,y,o):\n if o =='+':\n  return x+y\n elif o=='-':\n  return x-y\n elif o=='*':return x*y\n elif o=='\/': \n  if y!=0:\n   return x\/y\n  else:\n   return 'error'\n else:\n  return 'Invalid'\n\na=10\nb=5\nop='*'\nprint('Result:',calc(a,b,op))<\/mark><\/strong><mark style=\"background-color:#000\" class=\"has-inline-color\"><code>\n<\/code><\/mark><\/code><\/pre>\n\n\n\n<p>vs.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong><mark class=\"has-inline-color has-paddletail-black-color\">def calculate(x, y, operator):\n    if operator == '+':\n        return x + y\n    elif operator == '-':\n        return x - y\n    elif operator == '*':\n        return x * y\n    elif operator == '\/':\n        if y != 0:\n            return x \/ y\n        else:\n            return 'Error: Division by zero'\n    else:\n        return 'Error: Invalid operator'\n\n# Example usage\nx = 10\ny = 5\noperator = '*'\nresult = calculate(x, y, operator)\nprint(f'Result: {result}')<\/mark>\n<\/strong><\/code><\/pre>\n\n\n\n<p>We see better variables names, error messages, and even simply more spaces between characters. The little things go a long way. Sometimes &#8220;simple&#8221; doesn&#8217;t mean &#8220;shorter&#8221;.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#8211; LeBlanc&#8217;s Law This statement couldn&#8217;t be more true. How many times in life has this been the case? &#8220;It looks okay right now, I think ill come back later to make it look nicer&#8221; &#8211; Me &#8220;I need to go finish this assignment, but ill do it later&#8221; &#8211; also Me I am going [&hellip;]<\/p>\n","protected":false},"author":14551,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-22","post","type-post","status-publish","format-standard","hentry","category-cs462"],"_links":{"self":[{"href":"https:\/\/blogs.oregonstate.edu\/tr3nn\/wp-json\/wp\/v2\/posts\/22","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.oregonstate.edu\/tr3nn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.oregonstate.edu\/tr3nn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/tr3nn\/wp-json\/wp\/v2\/users\/14551"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/tr3nn\/wp-json\/wp\/v2\/comments?post=22"}],"version-history":[{"count":14,"href":"https:\/\/blogs.oregonstate.edu\/tr3nn\/wp-json\/wp\/v2\/posts\/22\/revisions"}],"predecessor-version":[{"id":45,"href":"https:\/\/blogs.oregonstate.edu\/tr3nn\/wp-json\/wp\/v2\/posts\/22\/revisions\/45"}],"wp:attachment":[{"href":"https:\/\/blogs.oregonstate.edu\/tr3nn\/wp-json\/wp\/v2\/media?parent=22"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/tr3nn\/wp-json\/wp\/v2\/categories?post=22"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/tr3nn\/wp-json\/wp\/v2\/tags?post=22"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}