{"id":7530,"date":"2013-06-17T10:08:01","date_gmt":"2013-06-17T15:08:01","guid":{"rendered":"http:\/\/mjtsai.com\/blog\/?p=7530"},"modified":"2013-06-17T10:08:01","modified_gmt":"2013-06-17T15:08:01","slug":"finders-tellers","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2013\/06\/17\/finders-tellers\/","title":{"rendered":"Avoid Null Checks by Replacing Finders With Tellers"},"content":{"rendered":"<p><a href=\"http:\/\/michaelfeathers.typepad.com\/michael_feathers_blog\/2013\/06\/avoid-null-checks-by-replacing-finders-with-tellers.html\">Michael Feathers<\/a>:<\/p><blockquote cite=\"http:\/\/michaelfeathers.typepad.com\/michael_feathers_blog\/2013\/06\/avoid-null-checks-by-replacing-finders-with-tellers.html\"><p>The person method accepts an id for a person and a block.  If the person is found the block is called with the person.  Otherwise it isn&rsquo;t. Elegant, eh?  And, there are no nulls.<\/p><p>Lots of luck doing this in a language without blocks or lambdas.  I think that when the history of computing is finally written, one of the chapters will be about how much insanity thrived in the era before blocks were considered mainstream.<\/p><\/blockquote>","protected":false},"excerpt":{"rendered":"<p>Michael Feathers:The person method accepts an id for a person and a block. If the person is found the block is called with the person. Otherwise it isn&rsquo;t. Elegant, eh? And, there are no nulls.Lots of luck doing this in a language without blocks or lambdas. I think that when the history of computing is [&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":[168,27,71],"class_list":["post-7530","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-blocks","tag-craft","tag-programming"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/7530","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=7530"}],"version-history":[{"count":1,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/7530\/revisions"}],"predecessor-version":[{"id":7531,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/7530\/revisions\/7531"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=7530"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=7530"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=7530"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}