News for hackers. Stuff that matters.
Re:C/C++ Pointer Declaration Syntax – It makes sense by Suncho on Tuesday February 21, 2012 @06:18AM (#3616094)
Yes. This is how I first learned pointers when I was learning C. It makes perfect sense in C so long as you don't get crazy with typedefs or function pointers. It really breaks down in C++ where you have operator overloading that results in a situation where you have multiple types of iterators and smart pointers that all dereference to the same type.

Once you add references into the mix and it gets really confusing. I'm not really sure why they reused the ampersand to represent a reference type. Were there no other symbols left? It doesn't even follow the same rule from C. "int a" means that a is of type int. "int &a" does not mean that &a is of type int. Blah.

The cruft is ever building, but it started out very intuitive. Oh well.

Re:C/C++ Pointer Declaration Syntax – It makes sense by eru on Tuesday February 21, 2012 @06:28AM (#3616121)
My cynic guess for all the re-using of existing C syntax in new and confusing roles for C++ is that the creators of C++ shirked away from writing a new parser as much as possible.
Re:C/C++ Pointer Declaration Syntax – It makes sense by Suncho on Tuesday February 21, 2012 @07:02AM (#3616191)
At least in the case of dereferencing, I think it's more likely that C++ generalized something that C took for granted as having one specific meaning. C was created with the idea that the only thing that could ever be dereferenced was a memory address. C++ added flexibility to the system thereby violating this precept.
Re:C/C++ Pointer Declaration Syntax – It makes sense by scott_s on Tuesday February 21, 2012 @09:30AM (#3616534)
No, Stroustrup implemented a new parser before it was even called C++. He is very clear in "Design and Evolution of C++" and elsewhere why C++ is mostly backwards compatible with C: otherwise, he feared no one would use it.
Re:C/C++ Pointer Declaration Syntax – It makes sense by BudVVeezer on Tuesday February 21, 2012 @09:27AM (#3616518)
There's a really interesting paper on the origins of C++, written by Bjarne himself:

http://www2.research.att.com/~bs/hopl2.pdf