No way is nested ternaries easier to read than if/else if statements. Teraries should be used for if/else statements only. Nesting them is insane. It reminds me of if/else if operations in Excel.
If you've ever had to write a conditional in Microsoft Excel, you'll be familiar with this. Check out this article to see what I mean: exceljet.net/excel-functions/excel....
Excel doesn't have if/else if statements, it only has if/else which is the same as a ternary. Do you really think reading this is easier?
=IF(C6<70,"F",IF(C6<75,"D",IF(C6<85,"C",IF(C6<95,"B","A"))))
No way is nested ternaries easier to read than if/else if statements. Teraries should be used for if/else statements only. Nesting them is insane. It reminds me of if/else if operations in Excel.
Yes is similar, the Excel formulas are something like fp
what do you mean by this?
If you've ever had to write a conditional in Microsoft Excel, you'll be familiar with this. Check out this article to see what I mean: exceljet.net/excel-functions/excel....
Excel doesn't have if/else if statements, it only has if/else which is the same as a ternary. Do you really think reading this is easier?
=IF(C6<70,"F",IF(C6<75,"D",IF(C6<85,"C",IF(C6<95,"B","A"))))
It is just a proposal, for me an excel formula is just as ugly as an if..else..elseif with nesting.