{"id":48,"date":"2007-03-21T15:37:38","date_gmt":"2007-03-21T23:37:38","guid":{"rendered":"http:\/\/dougmccune.com\/blog\/2007\/03\/21\/try-to-read-this-code\/"},"modified":"2007-03-21T15:37:38","modified_gmt":"2007-03-21T23:37:38","slug":"try-to-read-this-code","status":"publish","type":"post","link":"https:\/\/dougmccune.com\/blog\/2007\/03\/21\/try-to-read-this-code\/","title":{"rendered":"Try to read this code"},"content":{"rendered":"<p>I often use the <a href=\"http:\/\/en.wikipedia.org\/wiki\/%3F:\">?:<\/a> format for conditional tests (Wikipedia tells me this is called a <a href=\"http:\/\/en.wikipedia.org\/wiki\/Ternary_operator\">ternary conditional expression<\/a>), it makes code short and sweet and often easily readable. But I was digging through some of the Flex framework source (mx.containers.Panel line 801) and came across this line:<\/p>\n<pre>\r\n<code>\r\nvm.bottom = o.bottom + (isNaN(btb) ? \r\n  (controlBar && !isNaN(btt) ? btt : isNaN(btl) ? bt : btl) : \r\n  btb);\r\n<\/code>\r\n<\/pre>\n<p>Honestly?<\/p>\n<p>I&#8217;ve used conditional expressions a lot, and even nested conditional expressions occasionally, but adding that third level of nesting makes a line of code that I can hardly read. My head almost exploded.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I often use the ?: format for conditional tests (Wikipedia tells me this is called a ternary conditional expression), it makes code short and sweet and often easily readable. But I was digging through some of the Flex framework source (mx.containers.Panel line 801) and came across this line: vm.bottom = o.bottom + (isNaN(btb) ? (controlBar [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[2],"tags":[],"class_list":["post-48","post","type-post","status-publish","format-standard","hentry","category-flex"],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/dougmccune.com\/blog\/wp-json\/wp\/v2\/posts\/48","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dougmccune.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dougmccune.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dougmccune.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dougmccune.com\/blog\/wp-json\/wp\/v2\/comments?post=48"}],"version-history":[{"count":0,"href":"https:\/\/dougmccune.com\/blog\/wp-json\/wp\/v2\/posts\/48\/revisions"}],"wp:attachment":[{"href":"https:\/\/dougmccune.com\/blog\/wp-json\/wp\/v2\/media?parent=48"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dougmccune.com\/blog\/wp-json\/wp\/v2\/categories?post=48"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dougmccune.com\/blog\/wp-json\/wp\/v2\/tags?post=48"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}