Gareth Owen said:
Can you lay off "the isn't worthy of being called a programmer"
schtick. It's incredibly patronising.
My comments were no more patronizing or condescending than the
comments of yours (snipped out of your reply) that I was
responding to.
I've never argued about programmers who "can" or "can't".
Comprehension is not a binary "can comprehend" and "can't comprehend".
I can comprehend the writing of JK Rowling and James Joyce, but one
of them is lot less work. But, I'd like to think that good
programmers would strive to be more like the former than the latter.
Good authors, maybe not.
This analogy misses the point, IMO, in several different ways.
C has a precise semantics; English does not. All programmers
write code as well as read it, whereas readers of English typically
don't also write, at least not on the scale of whole books.
Moreover the difference in scale makes the offered comparison
rather pointless -- in code the writing under consideration
is one "clause" of one "sentence", but the books are many
chapters of many paragraphs of (usually) multiple sentences
each. A better analogy would be to ask if someone understands
the difference between a restrictive clause and a non-restrictive
clause, which any competent writer will.
I can read comprehend ?:, and in simple expressions it can be much
more eloquent. There are places where the brevity of ?: gives a
program extra clarity for the reader. But when the expressions are
complex that clarity is lost, comprehension becomes much harder work
and the only gain is a little less typing. That's a poor tradeoff, if
your code is ever to be maintained by people less eloquent in C than
yourself.
If you'll recall the comments in your earlier posting were
written in response to the text
(upthread)>> [... on expressions like 'a = b ? c : d' ...]
So the comments above need to be made a bit more explicit
if you want them to convey any significant amount of useful
information.
My point is merely this. If I use ?: in complex expressions, what is
the benefit and what do I gain?
That isn't a point, it's a question. If the posting had asked a
question (and meant it as a question) the response/answer to it
would have been quite different. Of course it's often true that
people ask rhetorical questions as a way of making a point
rather than meaning it as a question. In my experience this
usually means either that they don't really know just what
their point is or they're afraid to say it straight out
because if said directly the ridiculousness of the comment
would be obvious. So if there's something you want to
say (or a question you want to ask), my advice is to
say it (or ask it) clearly and directly.