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 && !isNaN(btt) ? btt : isNaN(btl) ? bt : btl) : btb);
I’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.
- Pretty sweet logo, whoever designed that must be pretty much the best person in the world. Get your 360|Flex stuff here. And if you haven't registered for 360Flex, do that here.
- Since the next 360|Flex is fast approaching, I thought I'd post the full recording of my session at the last 360|Flex in Seattle. You can do whatever you want with this video, embed it wherever, watch it wherever, you can even download the original mp4 video file. Hopefully the embedded…