{"id":40,"date":"2021-10-07T08:16:13","date_gmt":"2021-10-07T08:16:13","guid":{"rendered":"https:\/\/blogs.oregonstate.edu\/davidkaff\/?p=40"},"modified":"2021-10-28T07:07:08","modified_gmt":"2021-10-28T07:07:08","slug":"3-thing-i-learned-after-db","status":"publish","type":"post","link":"https:\/\/blogs.oregonstate.edu\/davidkaff\/2021\/10\/07\/3-thing-i-learned-after-db\/","title":{"rendered":"Three Things I Learned After Taking a &#8220;Databases&#8221; Course"},"content":{"rendered":"\n<p>I&#8217;m currently working on a blog post about the work I did last winter in my &#8220;Intro to Databases&#8221; course. In that course I teamed up to build a super awesome <strong>CSA farm database-driven website<\/strong>. That post isn&#8217;t quite ready, so this week I&#8217;m going to discuss what I found when I reopened the repository:<\/p>\n\n\n\n<div style=\"height:30px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>It turns out, I&#8217;ve learned quite a bit in the last eight months!<\/p>\n\n\n\n<div style=\"height:30px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Documentation \u2013 not completely evil<\/h2>\n\n\n\n<div style=\"height:30px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>Last winter I was also taking &#8220;Intro to Software Engineering 1&#8221;. Just as I was getting to the main bit of &#8220;business logic&#8221; for my database project, my S.E. course was beginning to drill down on &#8220;refactoring&#8221;, &#8220;code-smells&#8221;, and how all code comments are evil and lazy.<\/p>\n\n\n\n<div style=\"height:30px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p><em>(&#8220;business logic&#8221;, another term I&#8217;ve learned since last winter!)<\/em><\/p>\n\n\n\n<div style=\"height:30px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>The business logic in question is an algorithm that manages the distribution of produce into boxes which are then picked up by farm supporters. The logic is run anytime new produce comes in, current produce needs to be spoiled out, and supporters join or leave.<\/p>\n\n\n\n<div style=\"height:30px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>To put it lightly, it&#8217;s a chonker of a task. <\/p>\n\n\n\n<div style=\"height:30px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>But filled to the brim with enthusiasm and <a href=\"http:\/\/refactoring.guru\" target=\"_blank\" rel=\"noreferrer noopener\">refactoring.guru<\/a> tidbits about &#8216;spaghetti code&#8217; and &#8216;self-explanatory names&#8217; I opted to write the entire thing as dozens of 5-liner functions without a single comment. \ud83d\ude28<\/p>\n\n\n\n<div style=\"height:30px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>I&#8217;m still a firm believer in the techniques of &#8220;Extract Method&#8221; and &#8220;Rename Method&#8221;. However, I&#8217;m also a believer in the fact that this code needs more documentation to be considered complete.<\/p>\n\n\n\n<div style=\"height:30px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>Making small, well-named functions just wasn&#8217;t enough for <em>anyone<\/em> to pick up the code and understand it, and refusing to add comments didn&#8217;t help.<\/p>\n\n\n\n<div style=\"height:30px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>We live and learn, and now at the top of my refactoring todo list for the project is: &#8220;Write concise documentation for the big algorithm&#8221;.<\/p>\n\n\n\n<div style=\"height:30px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Commit early, often, and always. Also branch.<\/h2>\n\n\n\n<div style=\"height:30px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>Another cardinal sin that I <em>committed<\/em> (hehe) when crafting the megalith algorithm was that I pushed the entire thing in one go. <\/p>\n\n\n\n<div style=\"height:30px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>To main. <\/p>\n\n\n\n<div style=\"height:30px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>With no intermediate commits. <\/p>\n\n\n\n<div style=\"height:30px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>\ud83d\ude35\u200d\ud83d\udcab<\/p>\n\n\n\n<div style=\"height:30px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>I did create a local branch when I started development, but that was the last I thought of git while working on it. Besides, I completely neglected creating a branch in the repository.<\/p>\n\n\n\n<div style=\"height:30px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>For this low stakes project everything turned out fine \u2013 but that&#8217;s no excuse. Practice make permanent, so now I strive to more disciplined in my git behavior with each project I work on. I&#8217;ve learned to create remote branches, commit changes incrementally, and create peer reviewed pull requests!<\/p>\n\n\n\n<div style=\"height:30px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Test myself b4 I wreck myself<\/h2>\n\n\n\n<div style=\"height:30px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>The amount of time I took to develop the algorithm was\u2026 more than it needed to be. Thankfully, in the spring I learned that blitzing an algorithm is not the only way! \ud83d\ude42 \ud83d\ude42 \ud83d\ude42<\/p>\n\n\n\n<div style=\"height:30px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>Enter &#8220;Intro to S.E. 2&#8221;, and <a href=\"https:\/\/en.wikipedia.org\/wiki\/Test-driven_development\">Test Driven Development<\/a>. Imagine, actually defining what I wanted the algorithm to do BEFORE I spent several hours wading through asyncs and futures\u2026 amazing!<\/p>\n\n\n\n<div style=\"height:30px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>If I had used TDD, I would have ignored the asyncs at first because my tests for output correctness could be passed easier than my tests for speed. Only once the logic was figured out (and testing green!) would I have needed to swap awaits for futures and asyncs to boost performance and pass a further suite of tests. This would have saved significant time and sanity, so I want to implement TDD as much as possible in my future workflows.<\/p>\n\n\n\n<div style=\"height:30px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">~ r e f l e c t i o n ~<\/h2>\n\n\n\n<div style=\"height:30px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>In the fast pace of 17 units a term I sometimes forget that I\u2019m building anything other than assignments and test-readiness. It&#8217;s refreshing to reflect and see all the techniques I&#8217;m soaking up from sitting at my computer everyday. It\u2019s also calming to know that I will look at my current projects in another eight months and find just as much wrong with my process \u2013 because I\u2019ll be that much better!<\/p>\n\n\n\n<div style=\"height:30px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<hr class=\"wp-block-separator is-style-dots\" \/>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;m currently working on a blog post about the work I did last winter in my &#8220;Intro to Databases&#8221; course. In that course I teamed up to build a super awesome CSA farm database-driven website. That post isn&#8217;t quite ready, so this week I&#8217;m going to discuss what I found when I reopened the repository:&hellip; <a class=\"more-link\" href=\"https:\/\/blogs.oregonstate.edu\/davidkaff\/2021\/10\/07\/3-thing-i-learned-after-db\/\">Continue reading <span class=\"screen-reader-text\">Three Things I Learned After Taking a &#8220;Databases&#8221; Course<\/span><\/a><\/p>\n","protected":false},"author":11555,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[4,8],"class_list":["post-40","post","type-post","status-publish","format-standard","hentry","category-oregon-state-capstone-blog","tag-project-reflection","tag-roast-myself","entry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Three Things I Learned After Taking a &quot;Databases&quot; Course - David Kaff<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/blogs.oregonstate.edu\/davidkaff\/2021\/10\/07\/3-thing-i-learned-after-db\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Three Things I Learned After Taking a &quot;Databases&quot; Course - David Kaff\" \/>\n<meta property=\"og:description\" content=\"I&#8217;m currently working on a blog post about the work I did last winter in my &#8220;Intro to Databases&#8221; course. In that course I teamed up to build a super awesome CSA farm database-driven website. That post isn&#8217;t quite ready, so this week I&#8217;m going to discuss what I found when I reopened the repository:&hellip; Continue reading Three Things I Learned After Taking a &#8220;Databases&#8221; Course\" \/>\n<meta property=\"og:url\" content=\"https:\/\/blogs.oregonstate.edu\/davidkaff\/2021\/10\/07\/3-thing-i-learned-after-db\/\" \/>\n<meta property=\"og:site_name\" content=\"David Kaff\" \/>\n<meta property=\"article:published_time\" content=\"2021-10-07T08:16:13+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-10-28T07:07:08+00:00\" \/>\n<meta name=\"author\" content=\"David Kaff\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"David Kaff\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/blogs.oregonstate.edu\/davidkaff\/2021\/10\/07\/3-thing-i-learned-after-db\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/blogs.oregonstate.edu\/davidkaff\/2021\/10\/07\/3-thing-i-learned-after-db\/\"},\"author\":{\"name\":\"David Kaff\",\"@id\":\"https:\/\/blogs.oregonstate.edu\/davidkaff\/#\/schema\/person\/0d93f65fc3b5939cc721d30965e4f353\"},\"headline\":\"Three Things I Learned After Taking a &#8220;Databases&#8221; Course\",\"datePublished\":\"2021-10-07T08:16:13+00:00\",\"dateModified\":\"2021-10-28T07:07:08+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/blogs.oregonstate.edu\/davidkaff\/2021\/10\/07\/3-thing-i-learned-after-db\/\"},\"wordCount\":668,\"commentCount\":0,\"keywords\":[\"project reflection\",\"roast myself\"],\"articleSection\":[\"Oregon State Capstone Blog\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/blogs.oregonstate.edu\/davidkaff\/2021\/10\/07\/3-thing-i-learned-after-db\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/blogs.oregonstate.edu\/davidkaff\/2021\/10\/07\/3-thing-i-learned-after-db\/\",\"url\":\"https:\/\/blogs.oregonstate.edu\/davidkaff\/2021\/10\/07\/3-thing-i-learned-after-db\/\",\"name\":\"Three Things I Learned After Taking a \\\"Databases\\\" Course - David Kaff\",\"isPartOf\":{\"@id\":\"https:\/\/blogs.oregonstate.edu\/davidkaff\/#website\"},\"datePublished\":\"2021-10-07T08:16:13+00:00\",\"dateModified\":\"2021-10-28T07:07:08+00:00\",\"author\":{\"@id\":\"https:\/\/blogs.oregonstate.edu\/davidkaff\/#\/schema\/person\/0d93f65fc3b5939cc721d30965e4f353\"},\"breadcrumb\":{\"@id\":\"https:\/\/blogs.oregonstate.edu\/davidkaff\/2021\/10\/07\/3-thing-i-learned-after-db\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/blogs.oregonstate.edu\/davidkaff\/2021\/10\/07\/3-thing-i-learned-after-db\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/blogs.oregonstate.edu\/davidkaff\/2021\/10\/07\/3-thing-i-learned-after-db\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/blogs.oregonstate.edu\/davidkaff\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Three Things I Learned After Taking a &#8220;Databases&#8221; Course\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/blogs.oregonstate.edu\/davidkaff\/#website\",\"url\":\"https:\/\/blogs.oregonstate.edu\/davidkaff\/\",\"name\":\"David Kaff\",\"description\":\"fledgling software engineer\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/blogs.oregonstate.edu\/davidkaff\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/blogs.oregonstate.edu\/davidkaff\/#\/schema\/person\/0d93f65fc3b5939cc721d30965e4f353\",\"name\":\"David Kaff\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/secure.gravatar.com\/avatar\/feece6673b6f1dbb8044d124b27ad93d9c837024b690380c1f3a9cb710d0a470?s=96&d=mm&r=g\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/feece6673b6f1dbb8044d124b27ad93d9c837024b690380c1f3a9cb710d0a470?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/feece6673b6f1dbb8044d124b27ad93d9c837024b690380c1f3a9cb710d0a470?s=96&d=mm&r=g\",\"caption\":\"David Kaff\"},\"url\":\"https:\/\/blogs.oregonstate.edu\/davidkaff\/author\/kaffs\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Three Things I Learned After Taking a \"Databases\" Course - David Kaff","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/blogs.oregonstate.edu\/davidkaff\/2021\/10\/07\/3-thing-i-learned-after-db\/","og_locale":"en_US","og_type":"article","og_title":"Three Things I Learned After Taking a \"Databases\" Course - David Kaff","og_description":"I&#8217;m currently working on a blog post about the work I did last winter in my &#8220;Intro to Databases&#8221; course. In that course I teamed up to build a super awesome CSA farm database-driven website. That post isn&#8217;t quite ready, so this week I&#8217;m going to discuss what I found when I reopened the repository:&hellip; Continue reading Three Things I Learned After Taking a &#8220;Databases&#8221; Course","og_url":"https:\/\/blogs.oregonstate.edu\/davidkaff\/2021\/10\/07\/3-thing-i-learned-after-db\/","og_site_name":"David Kaff","article_published_time":"2021-10-07T08:16:13+00:00","article_modified_time":"2021-10-28T07:07:08+00:00","author":"David Kaff","twitter_card":"summary_large_image","twitter_misc":{"Written by":"David Kaff","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/blogs.oregonstate.edu\/davidkaff\/2021\/10\/07\/3-thing-i-learned-after-db\/#article","isPartOf":{"@id":"https:\/\/blogs.oregonstate.edu\/davidkaff\/2021\/10\/07\/3-thing-i-learned-after-db\/"},"author":{"name":"David Kaff","@id":"https:\/\/blogs.oregonstate.edu\/davidkaff\/#\/schema\/person\/0d93f65fc3b5939cc721d30965e4f353"},"headline":"Three Things I Learned After Taking a &#8220;Databases&#8221; Course","datePublished":"2021-10-07T08:16:13+00:00","dateModified":"2021-10-28T07:07:08+00:00","mainEntityOfPage":{"@id":"https:\/\/blogs.oregonstate.edu\/davidkaff\/2021\/10\/07\/3-thing-i-learned-after-db\/"},"wordCount":668,"commentCount":0,"keywords":["project reflection","roast myself"],"articleSection":["Oregon State Capstone Blog"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/blogs.oregonstate.edu\/davidkaff\/2021\/10\/07\/3-thing-i-learned-after-db\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/blogs.oregonstate.edu\/davidkaff\/2021\/10\/07\/3-thing-i-learned-after-db\/","url":"https:\/\/blogs.oregonstate.edu\/davidkaff\/2021\/10\/07\/3-thing-i-learned-after-db\/","name":"Three Things I Learned After Taking a \"Databases\" Course - David Kaff","isPartOf":{"@id":"https:\/\/blogs.oregonstate.edu\/davidkaff\/#website"},"datePublished":"2021-10-07T08:16:13+00:00","dateModified":"2021-10-28T07:07:08+00:00","author":{"@id":"https:\/\/blogs.oregonstate.edu\/davidkaff\/#\/schema\/person\/0d93f65fc3b5939cc721d30965e4f353"},"breadcrumb":{"@id":"https:\/\/blogs.oregonstate.edu\/davidkaff\/2021\/10\/07\/3-thing-i-learned-after-db\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/blogs.oregonstate.edu\/davidkaff\/2021\/10\/07\/3-thing-i-learned-after-db\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/blogs.oregonstate.edu\/davidkaff\/2021\/10\/07\/3-thing-i-learned-after-db\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/blogs.oregonstate.edu\/davidkaff\/"},{"@type":"ListItem","position":2,"name":"Three Things I Learned After Taking a &#8220;Databases&#8221; Course"}]},{"@type":"WebSite","@id":"https:\/\/blogs.oregonstate.edu\/davidkaff\/#website","url":"https:\/\/blogs.oregonstate.edu\/davidkaff\/","name":"David Kaff","description":"fledgling software engineer","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/blogs.oregonstate.edu\/davidkaff\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/blogs.oregonstate.edu\/davidkaff\/#\/schema\/person\/0d93f65fc3b5939cc721d30965e4f353","name":"David Kaff","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/feece6673b6f1dbb8044d124b27ad93d9c837024b690380c1f3a9cb710d0a470?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/feece6673b6f1dbb8044d124b27ad93d9c837024b690380c1f3a9cb710d0a470?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/feece6673b6f1dbb8044d124b27ad93d9c837024b690380c1f3a9cb710d0a470?s=96&d=mm&r=g","caption":"David Kaff"},"url":"https:\/\/blogs.oregonstate.edu\/davidkaff\/author\/kaffs\/"}]}},"_links":{"self":[{"href":"https:\/\/blogs.oregonstate.edu\/davidkaff\/wp-json\/wp\/v2\/posts\/40","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.oregonstate.edu\/davidkaff\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.oregonstate.edu\/davidkaff\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/davidkaff\/wp-json\/wp\/v2\/users\/11555"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/davidkaff\/wp-json\/wp\/v2\/comments?post=40"}],"version-history":[{"count":7,"href":"https:\/\/blogs.oregonstate.edu\/davidkaff\/wp-json\/wp\/v2\/posts\/40\/revisions"}],"predecessor-version":[{"id":51,"href":"https:\/\/blogs.oregonstate.edu\/davidkaff\/wp-json\/wp\/v2\/posts\/40\/revisions\/51"}],"wp:attachment":[{"href":"https:\/\/blogs.oregonstate.edu\/davidkaff\/wp-json\/wp\/v2\/media?parent=40"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/davidkaff\/wp-json\/wp\/v2\/categories?post=40"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/davidkaff\/wp-json\/wp\/v2\/tags?post=40"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}