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:
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.