Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Ternary Operator

Name: Anonymous 2010-01-08 8:07

ALL HAIL!

Name: Anonymous 2010-01-08 9:32

It should have been the default behaviour of the if statement. There should have never been a need to make a ternary operator. There should be no real statements, almost everything should be an expression. if (a) b c should itself return the value. A value which you could further use. If the value is unused, there is no harm, the compiler just frees those resources up. Languages which knew how to do it right, just had almost everything returning a value(think Lisp, ML, but there are many others that do it right), and then you could wire the outputs directly. While I do use the ternary operator in C less than if for aesthetic reasons, even if it has the functionality if should have always had.  Its syntax looks uglier than the if statement. Default IF behaviour impedes functional dataflow.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List