Re: Is pointer syntax logical?
Re: Is pointer syntax logical?
- Subject: Re: Is pointer syntax logical?
- From: Jacob Engstrand <email@hidden>
- Date: Thu, 26 Jul 2007 13:52:18 +0200
On 26 jul 2007, at 12.14, Alastair Houghton wrote:
On 26 Jul 2007, at 08:58, Bob Ueland wrote:
[...deletia...]
Some people *insist* on writing the asterisk (or in C++ the
ampersand) in the wrong place, e.g.
Fraction* aFraction;
This one again! I really shouldn't go for this obvious bait, but in
the interest of signal/noise (and so we can kill this thread right
here and now), I will attempt to end this thread by giving C++
inventor Bjarne Stroustrup the last word:
A ``typical C programmer'' writes ``int *p;'' and explains it ``*p is
what is the int'' emphasizing syntax, and may point to the C (and C+
+) declaration grammar to argue for the correctness of the style.
Indeed, the * binds to the name p in the grammar.
A ``typical C++ programmer'' writes ``int* p;'' and explains it ``p
is a pointer to an int'' emphasizing type. Indeed the type of p is
int*. I clearly prefer that emphasis and see it as important for
using the more advanced parts of C++ well.
More at: http://www.research.att.com/~bs/bs_faq2.html#whitespace
jak
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden