Re: unusual OR syntax

The Natural Philosopher <tnp@xxxxxxxxxxxxxxx> writes:

Michael Fesser wrote:
.oO(The Natural Philosopher)

you need to program for idiots to understand, or teh mainteance coders
will be operating below efficiency.

And the better programmers, who don't code for idiots, "need firing"?

They aren't better.

Yes they are. Since they learnt the language they are using and utilise
the features.

This is where it all becomes a matter of perspective.

There are two : use the language as it was intended or don't because you
assume others are too stupid to follow it. Programming for the lowest
denominator is never a good idea. Where does it end?

From the management point of view, what you want is reliable
maintainable bug free code at the minimum cost.

No. You want reliable maintainable code at a reasonable cost : not code
with arbitrarily chosen adherence to that languages features.

The best programmers are those that work together in harmony to achieve

Indeed. And use the language as it was intended. Some programmer with
limited real work experience who decides on his own set of what is
"reasonable" is more often than not an obstruction to progress and will
attract the enmity of programmers wanting to use the language correctly.

Smartasses upset everybody, and their extreme knowledge of the languages
they use are generally not needed and actually counter productive: They
are not writing code for the company, but for their own egos.

There is nothing "smart arse" about this OR issue. It is well defined in
many languages.

They get off on winning arguments, and demonstrating their superiority
of intellect, and knowledge.

Nothing of the sort. Gratuitously "clever" code is never
appreciated. Using something as basic as this OR behaviour is hardly that.

Their personal goals and personality defects are counter to the
companies goals.

Personal goals? You appear to be taking this to a new level. Surely you
can not be talking about the well defined short circuiting of or
statements in php (and C and ...).

If you cannot find a niche where their skills are useful, then do them
the favour of firing them.

Fire good programmers who use the correct language features? Wow.

Lazy ORs are not rocket science.
No, but they break the pure logic of procedure.

Not really. In pure logic the second argument of an OR operation is
totally irrelevant if the first one already evaluates to TRUE:

But the question is then which is the second argument.

The programmer decides. Its what they do ....

If I say 'fetch me a spanner or a screwdriver' I presumably don't care
which I get. There is no implicit logic there that says if you find

That is the English language. Not PHP.

both, I prefer the spanner..Or indeed to say if you should look for teh
spanner first, and only if you fail to find it, look for the screwdriver..

x y | x|y
0 0 | 0
0 1 | 1
1 0 | 1 <--
1 1 | 1 <--

In other words: TRUE OR y := TRUE

In such case it simply doesn't matter what y happens to be, so you could
say that there's no need to evaluate the exact realtime value.

But which is the order?

Look at the PHP manual. What do you mean? It is 100% well defined. What
do you mean "what is the order"? It's left to right.