{"id":12603,"date":"2015-10-20T15:51:53","date_gmt":"2015-10-20T19:51:53","guid":{"rendered":"http:\/\/mjtsai.com\/blog\/?p=12603"},"modified":"2015-10-20T15:51:53","modified_gmt":"2015-10-20T19:51:53","slug":"string-interfaces","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2015\/10\/20\/string-interfaces\/","title":{"rendered":"String Interfaces"},"content":{"rendered":"<p><a href=\"http:\/\/www.tedunangst.com\/flak\/post\/string-interfaces\">Ted Unangst<\/a> (via <a href=\"https:\/\/alpha.app.net\/jws\/post\/65311973\">Jeremy W. Sherman<\/a>):<\/p>\n<blockquote cite=\"http:\/\/www.tedunangst.com\/flak\/post\/string-interfaces\"><p>Although using strings subverts C&rsquo;s already weak type checking, that&rsquo;s probably not a major concern. One can screw up bit masks by using <code>||<\/code> in place of <code>|<\/code>. Or, as above, one can incorrectly pack the magic array. It&rsquo;s usually much easier to visually audit a string than the C code used to plaster a dozen option together.<\/p>\n<p>Of course, one should not use a string interface if it doesn&rsquo;t make sense, but we need not reject the concept out of hand without at least some consideration.<\/p><\/blockquote>\n<p>Another example is <a href=\"https:\/\/www.mikeash.com\/pyblog\/friday-qa-2014-01-24-introduction-to-libclang.html\">libclang<\/a>.<\/p>","protected":false},"excerpt":{"rendered":"<p>Ted Unangst (via Jeremy W. Sherman): Although using strings subverts C&rsquo;s already weak type checking, that&rsquo;s probably not a major concern. One can screw up bit masks by using || in place of |. Or, as above, one can incorrectly pack the magic array. It&rsquo;s usually much easier to visually audit a string than the [&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":[230,27,71],"class_list":["post-12603","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-clang","tag-craft","tag-programming"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/12603","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=12603"}],"version-history":[{"count":1,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/12603\/revisions"}],"predecessor-version":[{"id":12605,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/12603\/revisions\/12605"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=12603"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=12603"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=12603"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}