Please see :

http://www.intellij.org/twiki/bin/view/Main/RefactoringSuggestionsForIDEA#bidirectional_conversion_if_else

Bissell, Tim wrote:
>>On 14 Jul 2002 at 6:21, Thomas Singer wrote:
>>
>>
>>>  int i = 1 < 2
>>>     ? 3
>>>      : 4;
>>
> 
>>If you are going to the trouble of doing this, why not make 
>>it a full blow if/then/else statement?  
>>The entire point of the ternary operator is to save vertical space.
>>
> 
> 
> It does save space over
> 
> if (1 < 2)
> {
>       i = 3;
> }
> else
> {
>       i = 4;
> }
> 
> because 
> 
> if (1 < 2) i = 3;
> else i=4;
> 
> is open to abuse if you want to add extra statements to the then or else
> clauses later.
> And it certainly saves space in a return statement:
> 
> return (obj == nil)
>               ? MyNilObject
>               : obj ;
> 

_______________________________________________
Eap-features mailing list
[EMAIL PROTECTED]
http://lists.jetbrains.com/mailman/listinfo/eap-features

Reply via email to