On 3/5/13 at 10:14 PM, fateman at cs.berkeley.edu (Richard Fateman)
wrote:
>On 3/5/2013 1:15 AM, Bill Rowe wrote:
>>The only advantage of @@@ is the saving of a few keystrokes and
>>perhaps improved readability for someone familiar with the meaning
>>of @@@.
>And decreased readability for someone unfamiliar with it and who
>tries ? @@@ to get documentation.
If the object is readability for someone unfamiliar with
Mathematica, then I absolutely would not use things like @@@.
But, I code things in Mathematica for myself not others. And I
find @@@ perfectly sensible and readable.
>>>I've mentioned it previously. But that's really a different
>>>point. There are many 3-character non-alphabet sequences. How
>>>many of them "mean" anything to you?
>>Several. But then I use Mathematica extensively. Short cuts like
>>@@@ are convenient for me. Consequently, I use them rather
>>frequently and don't have any problem recalling their meaning.
>You use @@@ frequently?
=46requently enough to not have to refer to the documentation to
figure out how it should behave.
>Or other shortcuts?
others as well.
>I use many, such as +, :=, ->, /., //, @ , ;. which are verbose
>otherwise, and at least for the first few, are already familiar. That
>is, x+y+z seems to be handy rather than Plus[x,y,z]. This compares to
>Lisp, slightly longer at (+ x y z)
If I had three variables, x,y,z defined, I would certainly code
their sum as x+y+z rather than Plus[x,y,z] or Plus@@{x,y,z}. But
if I had a variable mylist set to {x,y,z}, then I would either
code the sum as Plus@@myList or Total@myList or Total[myList]
Similarly if I myMatrix were a n x m array and I wanted to
compute the sum of each row, I might well code this as Plus@@@myMatrix.
My usage of shortcuts like @, @@ or @@@ is very context
dependent. Sometimes it is useful (and to me improves
readability) other times not so.
>>>As for @@@ being explained multiple times in this newsgroup, maybe
>>>you should wonder why
>>>(a) it should have to be explained even once
>>Since it is not universal, it follows there needs to be at least
>>one explanation somewhere. And since quite a few posters here
>>haven't read much of the documentation, it follows strings of
>>characters such as @@@ won't be familiar to them prompting a
>>request for an explanation.
>Maybe if ?@@@ worked, they won't have to ask.
It would not make much difference how Wolfram chose to document
@@@. The same questions would come up here since the questions
posted here make it quite apparent many posters simply haven't
read the documentation. I don't see that changing whether or not
?@@@ worked as you would like.
>>>(b) why it should have to be explained multiple times.
>>No matter how many times it is explained, there will always be
>>another new user encountering @@@ or some other short cut for the
>>first time prompting a new request for explanation.
>The proper response might be, type ?@@@
It seems (given the way Mathematica currently works) the proper
response is to say --- highlight @@@ by double clicking on one
of the @ characters or other suitable means then using (on a
Mac) cmd-shift-F which immediately brings up the appropriate documentation.
And if someone is trying to decipher a bit of code such as
Plus@@@myList
it seems easier and more sensible to select the @@@ portion and
use the technique described than to type ?@@@ in a new cell.
I personally do not know why Wolfram has not implemented
something so that you could do ?@@@. There may be some valid
reason or perhaps this was just overlooked. It really doesn't
matter to me. Yes, consistency is nice. But there are often good
reasons to break consistency. And it really isn't that much
trouble to high light the @@@ and use other key stroke short
cuts to bring up the documentation.
>>The existence of multiple explanations in this forum for @@@ isn't
>>an indication of "bad design".
>Actually, I disagree. I think that is supportive evidence of bad
>design that repeated explanations are needed.
Well we will have to disagree. Design of something reasonably
complex always involves trade offs. And no matter how the trade
off is made, there will always be someone who doesn't understand
and needs further explanation. And since there will always be
new users the same questions will come up again and again. That
is a fact of human nature having nothing to do with Mathematica
or poor design.
>>Your comments here and elsewhere in this thread seem to amount to
>>Mathematica is not easy for a new or casual user to use
>>proficiently. If so, I agree.
>I think you read me correctly. Though I would go further and say it is
>not easy for a person attempting to make serious use, who attempts to
>use his/her mathematical background and general knowledge of other
>programming languages and (say) computer arithmetic to make
>generalizations of how Mathematica should behave.
I won't disagree with what you've written above. It is quite
clear from various postings in this forum people who are
expecting Mathematica to behave like something else they have
experience with seem to have the most difficulty with Mathematica.
>But I believe the same is true of
>>many other if not most other programming languages.
>But not all?
Actually, I would claim it is true of all other programming
languages I am familiar with. But since there is a relatively
large number of programming languages I don't know, I leave open
the possibility of perhaps one of the ones I don't know has no
unique sequence of characters that only have meaning in that language.