{"id":5351,"date":"2012-07-17T15:33:17","date_gmt":"2012-07-17T20:33:17","guid":{"rendered":"http:\/\/mjtsai.com\/blog\/?p=5351"},"modified":"2012-07-17T15:33:20","modified_gmt":"2012-07-17T20:33:20","slug":"boolean-trap","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2012\/07\/17\/boolean-trap\/","title":{"rendered":"Boolean Trap"},"content":{"rendered":"<p><a href=\"http:\/\/ariya.ofilabs.com\/2011\/08\/hall-of-api-shame-boolean-trap.html\">Ariya Hidayat<\/a> (via <a href=\"https:\/\/twitter.com\/ID_AA_Carmack\/status\/224993619428392961\">John Carmack<\/a>):<\/p>\n<blockquote cite=\"http:\/\/ariya.ofilabs.com\/2011\/08\/hall-of-api-shame-boolean-trap.html\"><p>For this particular discussion, I&#8217;ll pick my favorite API design mistake: <b>boolean trap<\/b>. On <a href=\"http:\/\/developer.qt.nokia.com\/wiki\/API_Design_Principles#e7794937cba47d5e9c54d50a6a32328b\">this topic<\/a>, the above API Design Principle wiki page says that<\/p>\n<blockquote><p>it&rsquo;s almost invariably a mistake to add a bool parameter to an existing function<\/p><\/blockquote><\/blockquote>","protected":false},"excerpt":{"rendered":"<p>Ariya Hidayat (via John Carmack): For this particular discussion, I&#8217;ll pick my favorite API design mistake: boolean trap. On this topic, the above API Design Principle wiki page says that it&rsquo;s almost invariably a mistake to add a bool parameter to an existing function<\/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":[],"class_list":["post-5351","post","type-post","status-publish","format-standard","hentry","category-programming-category"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/5351","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=5351"}],"version-history":[{"count":2,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/5351\/revisions"}],"predecessor-version":[{"id":5353,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/5351\/revisions\/5353"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=5351"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=5351"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=5351"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}