|
|
Subscribe / Log in / New account

Poor arguments against

Poor arguments against

Posted Feb 16, 2015 12:31 UTC (Mon) by etienne (guest, #25256)
In reply to: Poor arguments against by HelloWorld
Parent article: Scalar typing in the PHP world

> Sensible languages (...) don't need a logical xor

Well, "^" and "!=" have different priorities, so you may want the (small) difference to reduce use of parenthesis.
if (a != b + 1) {}
if (a ^ b + 1) {}


to post comments

Poor arguments against

Posted Feb 17, 2015 20:05 UTC (Tue) by HelloWorld (guest, #56129) [Link]

Fair enough. Though I suspect that logical xor is actually quite a rare occurrence.

Poor arguments against

Posted Mar 9, 2015 21:33 UTC (Mon) by ggiunta (guest, #30983) [Link] (1 responses)

Not sure if you mean this as a joke, or not, but given the general tone of this thread, I imagine everyone here is wearing their asbestos underwear already, so off we go...

I would fail your abuse of knowledge of operators precedence in a code review, and force you to always add parenthesis to your code, lest you be removed from my dev team.

Code is not supposed to be ascii art, and there is a definite limit to the benefits of terseness. Do you have a disease limiting your fingers movement? Maybe your keyboard has a couple of missing keys? What is the problem with 2 extra characters???

Someone else already stated above (or below) that code is meant to be understandable by humans first (meaning other beings than the one who wrote it in the 1st place), and execute correctly second. Amen to that.

With that off my chest, let me wax lyrical about how a bunch of extremely intelligent, highly trained, experienced developers, such as the majority of readers here surely are, seem to go nuts every single time discussions about programming languages arise (and systemd, but I think that wound will heal quicker than expected given a bit of time).
PHP is everyone's favourite scapegoat of course, but here it inexplicably got beaten to 1st place flamewar-topic by none the less than Perl! (while the Lisp gurus were somehow asleep in their caves and missed all the fun).

Is there anything we can learn from this?

Personally, what I think is that language design is not an exact science, and that we developers can not definitely not yet call ourselves engineers with a straight face. Otherwise there would not be so much disagreement, pure and simple. We're all still a bunch of artisans. Except the few ones who are truly just religious zealots ;-)

Poor arguments against

Posted Mar 12, 2015 12:13 UTC (Thu) by etienne (guest, #25256) [Link]

> asbestos underwear
> I would fail your abuse of knowledge of operators precedence in a code review, and force you to always add parenthesis to your code, lest you be removed from my dev team.

I may fail your (??abuse of??) reading and understanding English course.
I gave two C lines to show that "!=" and "^" cannot be exchanged without changing the meaning, even when simple case like "if(a != b){}" and "if(a ^ b){}" are obviously identical.

Poor arguments against

Posted Mar 10, 2015 0:44 UTC (Tue) by mpr22 (subscriber, #60784) [Link] (1 responses)

A gentlebeing knows the complete order of operator precedence in C. A true gentlebeing is never so discourteous as to demand that anyone else do so.

Poor arguments against

Posted Mar 10, 2015 6:12 UTC (Tue) by bronson (subscriber, #4806) [Link]

Beautiful and true.


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds