{"id":16174,"date":"2016-10-29T15:48:27","date_gmt":"2016-10-29T19:48:27","guid":{"rendered":"http:\/\/mjtsai.com\/blog\/?p=16174"},"modified":"2016-10-29T15:48:27","modified_gmt":"2016-10-29T19:48:27","slug":"good-coding-taste","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2016\/10\/29\/good-coding-taste\/","title":{"rendered":"Good Coding Taste"},"content":{"rendered":"<p><a href=\"https:\/\/medium.com\/@bartobri\/applying-the-linus-tarvolds-good-taste-coding-requirement-99749f37684a\">Brian Barto<\/a>:<\/p>\n<blockquote cite=\"https:\/\/medium.com\/@bartobri\/applying-the-linus-tarvolds-good-taste-coding-requirement-99749f37684a\"><p>But it wasn&rsquo;t the line count that mattered. It was that if-statement. It&rsquo;s gone. No longer needed. The code has been refactored so that, regardless of the object&rsquo;s position in the list, the same process is applied to remove it.<\/p><p>[&#8230;]<\/p><p>To the best of my ability to discern, the crux of the &ldquo;good taste&rdquo; requirement is the elimination of edge cases, which tend to reveal themselves as conditional statements. The fewer conditions you test for, the better your code &ldquo;<em>tastes&rdquo;<\/em>.<\/p><\/blockquote>\n<p>It&rsquo;s an interesting example because the &ldquo;bad&rdquo; version has more state and branching, but some programmers would find the &ldquo;good&rdquo; version harder to understand, due to the indirection and attendant C syntax.<\/p>","protected":false},"excerpt":{"rendered":"<p>Brian Barto: But it wasn&rsquo;t the line count that mattered. It was that if-statement. It&rsquo;s gone. No longer needed. The code has been refactored so that, regardless of the object&rsquo;s position in the list, the same process is applied to remove it.[&#8230;]To the best of my ability to discern, the crux of the &ldquo;good taste&rdquo; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"","apple_news_api_id":"","apple_news_api_modified_at":"","apple_news_api_revision":"","apple_news_api_share_url":"","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[4],"tags":[45,27,71],"class_list":["post-16174","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-c","tag-craft","tag-programming"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/16174","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=16174"}],"version-history":[{"count":1,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/16174\/revisions"}],"predecessor-version":[{"id":16175,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/16174\/revisions\/16175"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=16174"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=16174"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=16174"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}