ID:175627
 
It's been so long since I've last used BYOND that I forgot wat "||" means. Please respond.

Thanx, DiZzyBonne
|| means OR, you could have just checked the reference.
In response to Nadrew
I thought (but i wasn't sure) that it meant or, so I checked the reference, and I really didnt understand the explanation.

Thanx, DiZzyBonne
In response to DiZzyBonne
Format:
A || B
Returns:
true value if either A or B is nonzero; false value otherwise


Damn those vague statements!! =)

-=Ken=-
In response to NeoHaxor
Actually, that is rather confusing coder-babble to someone who doesn't know the "language" of programmers...

Granted, a layman could probably figure it out with a little thought, but a quick read could be very overwhelming... Perhaps confusing enough on the first pass to make a closer, more comprehensive read seem too daunting...

In fact, I find that to be a major problem with the reference... Most people here simply direct people to look things up for their answers, but they don't realize that if someone is having trouble with a piece of code, then chances are, that someone doesn't know enough to even understand the reference... And all they're doing is making the problem worse... Not answering the question in a way that actually helps the person asking it...

This is one of the reasons I love the Blue Book so much... It contains much less coder-babble and puts things into plain english much better than the reference...

And now that it's been put online, perhaps that'll help out the "newbies"...
In response to SuperSaiyanGokuX
I would assume (but correct me if I am wrong) that a majority of the population of programmers (new and old) would, at least, have knowledge of some mathematical logic which is taught in most public schools throughout highschool mathematics classes. Logic is all this statement is, aside from the A||B piece, the rest should be easy to comprehend.

-=Ken=-
In response to NeoHaxor
It really isn't as straightforward as it sounds to you or me...

"Format:
A || B
Returns:
true value if either A or B is nonzero; false value otherwise
"

For one, the word "Returns" is rather difficult to grasp to someone who doesn't know what its meaning is in programming... Sure, everyone knows that "return" means "send back" or something of that nature... But someone who is unfamiliar with how it all works beforehand doesn't necessarily know that it works by sending a value back... "Return" in this case becomes a stumbling block, because not everyone knows that operators send a value back...or that that simple fact is how everything works... Someone unfamiliar with the basics of programming wont necessarily even be expecting things to work with 1's and 0's (or TRUE and FALSE)...

Then, we get into the explanation of what it returns...

"true value if either A or B is nonzero"

Meh? I don't know what it means to begin with that it's "returning" something... And now, it's throwing all of this "true value" and "nonzero" stuff at me... Does that mean that it returns whichever of the two compared values that are the "true value"? Or what? And what if I'm using non-numerical values? How is that ever going to be a "zero" number? So won't they always be "nonzero"? How am I supposed to use this thing... I wasn't expecting it to give me an answer, I was expecting it to just do something...

"false value otherwise"

I surely don't understand this one if I don't understand the rest...


See? Yes, to someone who knows how it all works, it seems really simple... It checks both of the values, and gives you a "true" if either one is "true", or a "false" if neither one is true... We all know that...

But think of someone who has completely no prior programming knowledge (and/or no prior knowledge into how a computer works to begin with... not everyone knows that computers operate basically with nothing but 0's and 1's...which stand for "on" or "off", or "true" and "false"...)

It's really not as simple as it seems... It's certainly not in plain english...lol

[Edit:] And my point is that there's a pretty good chance that pretty much anyone asking questions on things we see as "simple" is programming illiterate enough to be confused by the reference... Telling them to go read it doesn't help them, because they won't understand it without understanding the underlying "forces" at work...

Of course, I suppose we can't teach the basics to everyone who comes through here, but we definitely shouldn't just expect someone to be able to get an answer to their question by simply reading the reference... Of course, if they're someone who has shown that they know a bit already about programming, then it's ok... But to a kid who comes in here with code that's all jumbled up, that doesn't even know what an "operator" is, it's going to do them more harm than good...