R
Robert Zurer
In his paper on Coding Standard found on
http://www.idesign.net/idesign/DesktopDefault.aspx
Juval Lowy discourages the use of the ternary conditional operator with no
specific reason given.
I can understand that complicated code would be much less readable using nested
operators, but aside from that is there another reason? -- something going on
under the hood perhaps which make it inadvisable to use?
Which one is better?
if(person != null)
{
return person.FirstName;
}
return null;
OR
return person != null ? person.FirstName : null;
Robert Zurer
http://www.idesign.net/idesign/DesktopDefault.aspx
Juval Lowy discourages the use of the ternary conditional operator with no
specific reason given.
I can understand that complicated code would be much less readable using nested
operators, but aside from that is there another reason? -- something going on
under the hood perhaps which make it inadvisable to use?
Which one is better?
if(person != null)
{
return person.FirstName;
}
return null;
OR
return person != null ? person.FirstName : null;
Robert Zurer