I tend to use the conditional operator mostly with one-line functions or properties. The idiomatic syntax is a lot easier in C# (my most used language) for one-line functions using the conditional operator.
New Hotness:
intMax(inta,intb)=>a>b?a:b;
Old and Busted:
intMax(inta,intb){if(a>b){returna;}returnb;}
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I tend to use the conditional operator mostly with one-line functions or properties. The idiomatic syntax is a lot easier in C# (my most used language) for one-line functions using the conditional operator.
New Hotness:
Old and Busted: