In an internal DL people were debating what all should be included in the next version of C#. One of the things I suggested turned into an interesting thread.
Abhinaba: Add if as expression (like in Ruby) so that I can do the following
var ageGroup = if age < 2
"Infant"
else if age < 19
"Teen";
SomeOne: Can't we do
var ageGroup = ((age < 2) ? "Infant" : ((age < 19) ? "Teen" : String.Empty));
Abhinaba: We can but put 4 more cases and it’ll start looking like Lisp :) with all the parenthesis.
SomeTwo: All programming languages evolve towards Lisp.
Yeah, right!!!
No comments:
Post a Comment