In response to Popisfizzy
Popisfizzy wrote:
That seems like it could be redundant.
> verb
> CheckThing()
> if(usr.thing == src.thing) usr << "YAY"
> else usr << "BooHoo"
> //isn't that the same as
> verb
> CheckThing()
> if(usr.thing != src.thing) usr << "BooHoo"
> else usr << "YAY"
>

Aren't those the same thing?

In your example, sure, but they are seldom used that way. For example:
verb
CheckThing()
if(usr.thing == src.thing)
// Ermm... don't want anything to happen here
else
usr << "BooHoo"

verb
CheckThing()
if(usr.thing != src.thing)
usr << "BooHoo"

As you can see, the second example is much nicer. :)
In response to Jon88
I'd probably more prone to use the first one, rather than the second.
In response to Theodis
Theodis wrote:
Unfortunantly until DM has cool compiler functionality that preprocesses expressions which can be computed at compile time you can't do anything like this with const variables.

That's certainly true, but most cases don't fall into that category.
Page: 1 2