{"id":124,"date":"2008-07-10T17:46:43","date_gmt":"2008-07-10T21:46:43","guid":{"rendered":"http:\/\/blogs.n1zyy.com\/andrew\/?p=124"},"modified":"2008-07-10T17:46:43","modified_gmt":"2008-07-10T21:46:43","slug":"willfull-ignorance","status":"publish","type":"post","link":"https:\/\/blogs.n1zyy.com\/andrew\/2008\/07\/10\/willfull-ignorance\/","title":{"rendered":"Willfull Ignorance"},"content":{"rendered":"<p>Sometimes, writing good code is really hard. But other times, writing good code is so darn easy you shouldn&#8217;t even have to think about it. In fact, it shouldn&#8217;t even be called &#8220;good code&#8221; &#8212; in these cases there should never be anything else, so we&#8217;ll just call it &#8220;code&#8221;.<\/p>\n<p>For instance, if I see another line of code that does this:<\/p>\n<pre>$foo = isset($foo) ? $foo : 'default value';<\/pre>\n<p>I think I&#8217;ll kill someone.<\/p>\n<p>Let me clear something up for you: <strong>using the ternary operator does <em>not<\/em> make you cool.<\/strong> However, assigning a variable to itself makes you very uncool.<\/p>\n<pre>if (!isset($foo)) $foo = 'default value';<\/pre>\n<p>Now why is that so hard to write?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sometimes, writing good code is really hard. But other times, writing good code is so darn easy you shouldn&#8217;t even have to think about it. In fact, it shouldn&#8217;t even be called &#8220;good code&#8221; &#8212; in these cases there should never be anything else, so we&#8217;ll just call it &#8220;code&#8221;. For instance, if I see [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,20,23,25],"tags":[],"class_list":["post-124","post","type-post","status-publish","format-standard","hentry","category-brilliance","category-php","category-programming","category-rants"],"_links":{"self":[{"href":"https:\/\/blogs.n1zyy.com\/andrew\/wp-json\/wp\/v2\/posts\/124","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.n1zyy.com\/andrew\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.n1zyy.com\/andrew\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.n1zyy.com\/andrew\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.n1zyy.com\/andrew\/wp-json\/wp\/v2\/comments?post=124"}],"version-history":[{"count":0,"href":"https:\/\/blogs.n1zyy.com\/andrew\/wp-json\/wp\/v2\/posts\/124\/revisions"}],"wp:attachment":[{"href":"https:\/\/blogs.n1zyy.com\/andrew\/wp-json\/wp\/v2\/media?parent=124"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.n1zyy.com\/andrew\/wp-json\/wp\/v2\/categories?post=124"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.n1zyy.com\/andrew\/wp-json\/wp\/v2\/tags?post=124"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}