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
this.

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.

.



Relevant Pages

  • Re: CollabRx seeks brilliant engineers for an excellent e-science adventure
    ... belief that lisp programmers are smarter/better. ... Java or PHP programmers. ... a type of language that attracts a personality that meets my perceptions ...
    (comp.lang.lisp)
  • Re: Language X, not Forth ?
    ... As you become more familiar with a language, it's readability is a function of how much care the programmer took to make it more readable. ... The use of non-readable graphics characters doesn't help FORTH to ... All programmers I know use one sort or another to indent or highlight control flow. ... Therefore, I just don't do this kind of crazy things like juggling around with many stack elements. ...
    (comp.lang.forth)
  • Re: Question concerning object-oriented programming
    ... programming language, not his. ... there has usually been a toString. ... I know it's "unrealistic" to expect actual programmers to do this, ... tell me what a dog is. ...
    (comp.programming)
  • Re: Does Python really follow its philosophy of "Readability counts"?
    ... with enforcing that "shouldn't" in the language itself? ... In Python, direct access to pointers is a MUST NOT. ... where you are allowed to mess with the implementation. ... human assembly language programmers? ...
    (comp.lang.python)
  • Re: Why do some people hate java?
    ... programming language like Java to exist, or if Java must exists, there's ... The majority of programmers at the time were using C++, ... and other resources that are just as important to ...
    (comp.lang.java.programmer)