if SomeBooleanVal { a = b; } else { a = c; } SomeFunction(a);
There are several lines of code which could be just one easy readable line width the same meaning:
SomeFunction(SomeBooleanVal ? b : c);
Since Delphi 7 (or 6?) there is an IfThen function in StrUtils and Math lib supporting similar functionality for string, Integer, Int64 and Double data types.
So look at the following example for detailed code:
if SomeBooleanVal a := b else a := c; SomeFunction(a);
And now at the much shorter code:
SomeFunction(IfThen(SomeBooleanVal, b, c);
While it helps keeping the code simpler, it sill has its limitations. The function is only defined for four data types and you would have to write another function for every data type you need which is not one of the four. The other limitation is simply the fact that it is a function and not a compiler feature like in other languages so there is no laziness possible. If you submit something more complex as b and c parameters like d *10 - e / 5, both values are evaluated first and the result of them sent to the function which would return the correct result depending on the boolean value. In C only the needed of both values would be evaluated and assigned to the target variable.
Of course with today's machines it's not the most ugly loss of efficiency, it still shows some limitations of a language design.
Edit:
+Eric Grange pointed another simple case which IfThen can't handle:
a := IfThen(c<>0, b/c)
Because evaluation happens before check you will get division by zero if c is zero.