Readable?
Jake Good - Code Poet

Microsoft Dynamics Vertical

Inetium can implement a CRM solution that fits your business needs.

Learn More >>

Inetium is the go to partner for Microsoft SharePoint consulting services.

Learn more >>

Syndication

I kinda dig this control statement syntax using the tertiary operator (?) (thanks to Bela for pointing it out):

object result =
  (<condition A>) ? resultIfA :
  (<condition B>) ? resultIfB :
  (<condition C>) ? resultIfC : 
defaultResult;

I think the reason why I like it is due to the fact that it makes the conditions readable, you don't have to jump through more lines of code... The ugly part is the colon / semi-colon marks at the ends of the lines. What do you think?


Posted 10-29-2007 3:17 PM by jgood
Filed under:
Inetium, LLC. Site Information