Pointers ARE a good thing in the hands of a skilled programmer.Originally Posted by orbitz
Pointers ARE a good thing in the hands of a skilled programmer.Originally Posted by orbitz
There are many cases in c++ where it is not possible to avoid casting. Probably the most common reason is downsizing a c++ class to one of its parents. There are literally thousands of examles where that is needed. I wouldn't say casting is bad at all -- you might as well say inheritence and polymorphism are bad and don't do either.
Last edited by Ancient Dragon; 09-19-2005 at 08:40 PM.
I find this argument to be fairly weak, personnely. Anything can be made to be good in the hands of a skilled individual. I think it is probably more important to discuss how much work it takes to prove the correctness of something. That way you can avoid how skilled the user of it is and focus on how well the tool solves your problem. Pointers are impossible to prove teh correctness of them when using. I don't mean prove correctness in the mathematical sense (since most programming langauges lack this, except maybe ML's). But rather, how much work it takes to be reasonbly sure you have not commited undefined behavior somewhere. And with pointers you, really, cannot be 100% sure of this. Another problem is, god forbid this magically skilled programmer, makes an error, pointers are very difficult to track down the error and properly solve it.Pointers ARE a good thing in the hands of a skilled programmer.
Polymorphism and inheritence can be implemented without allowing one to perform undefined behavior (i.e safely). Casts do not gurantee you have performed a safe operation, this is why langauges such as ML and python do not have any concept of casting, so i think your comparision is poor.I wouldn't say casting is bad at all -- you might as well say inheritence and polymorphism are bad and don't do either.
Last edited by orbitz; 09-19-2005 at 09:35 PM.
Also, there is no way to recover from an error caused by misuse of a pointer. One would think that would win over even the most fanatical pointer supporter.
At least I am attempting to make a case, which you really haven't done at all. All I've heard from you is opinion.Originally Posted by orbitz
There is a myriad of tools avialable to track down out of bound memory access. Its really not that hard to find these errors if they occur.Originally Posted by orbitz
Actually there is. You can capture the seg fault signal and keep the program from terminating. Also good coding habits and knowledge of how to use pointers correctly prevent this from being an issue.Originally Posted by orbitz
I suggest you really take some time away from your position and school yourself some more.
And since you know what: Mister C's question was answered lets just end this here.