Perusing through the C++ Faq-lite, searching for the page to describe a problem to a friend, I come across some references to pointer casting being "evil". First off, I think this is one of the most comprehensive and well written faqs on the web, but I'm going to have to go ahead and really seriously disagree with this one point.
http://www.parashift.com/c++-faq-lit...html#faq-27.10
He argues the evilness of other things such as arrays and #defines. I'm inclined to agree on the #defines, and moderatly to a few of his points on arrays. But this casting of types to new types being a problem is simply ridiculous.
The concept of a feature of C++ being potentially "dangerous" is in no way an argument against it, IMHO. Perhaps one could suggest that container classes are easier than arrays, and type casting should be avoided, when talking to someone _very_ new to C++. But personally I would recomend the practice in using them. How else will one learn? These concepts are intrinsic to the language, and their understanding imparts more than simply the ability to use them.
I mean, pointer casting (especially to void and back) is rather essential. In some instances I can think of no other way to accomplish certain tasks... And its just plain easier and faster for others. Are we stupid or something? Nobodys going to cast 'foo*' to 'bar*' unless they're both derived from type 'gibble'. And if you do, you're an idiot, and its not the fault of the feature you're using. Theres a million ways to seriously fsk up your app. Why single out this one, simply because its easy to do?
If I say
int i;
delete i;
Is it the fault of the delete operator, or am I just plain stupid? ... Exactly.
P.S. Yes, I'm aware that I finally post after months of almost straight silence, and its this irrelevant piece of drivel... What can I say?