View Single Post
05-06-2009, 02:16 PM
La Vida es Sueño
Join Date: Sep 2007
In your example, you really don't need that
because it's going to happen irrespective of anything else. In those examples where it either
, then check for an
, and the
will be the default.
Think of it in binary terms, yes/no, true/false, 0/1. If you check for the yes
, then the no
is the resulting value, and can be returned as such.
It's when you introduce more complicated conditionals that it requires more thinking on your behalf, such as with hexadecimal (base-16), and even our base-10 counting system. Anything other than base-2 (binary), where we only have the possibility of 2 outcomes, which is fundamentally how computers work
(and many more things, too)
, and so tends to be used quite commonly in everyday life, and to keep the topic relevant, in programming also.
I don't think there is any such performance gain, it's personal preference for readability, really.
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
View Public Profile
Send a private message to Wildhoney
Visit Wildhoney's homepage!
Find More Posts by Wildhoney