No, I'm not saying that. I'm saying "I can do that by myself, but somebody may prefer to do it differently".
Ähm... no? TStream cant handle a call to Read or Write, it literally needs a descendent class to do so.
No. The function pointers and virtual functions are clearly declared. OTOH the exception can appear from virtually nowhere (or everywhere), skipping most of your code. Combined with the manual memory management of Object Pascal you are obliged to enclose all your code with try ... finally.
They can only skip your code when you don't handle them. You as a programmer are in full control if your code get's skipped or not. If you don't want your code to be skipped, just use try-except. Exceptions should never skip code you as a programmer do not intend to skip. Also, you can skip code with virtual methods. When you have class with Virtual Method M, which you fill with code, the user can simply inherit from that class, override M and not call inherited in it, and all your precious code is skipped, without you being able to do anything against it (unlike exceptions, where if you don't want your code to be skipped, just catch it).
Also, as I have said in many posts before, you should always use try-finally even if no exceptions are present, because try-finally also triggers on all other forms of jumps like continue, exit or break. Try-Finally is not just for exceptions, it is a safeguard that if you want to prematurely exit that code (e.g. by calling exit), you don't have to think about all the cleanup.
You shouldn't be able to instantiate such a class at the first place.
And as I stated in my previous post, I think code that calls a function that can throw an exception, but does not handle that exception should also not compile (as it is the case in Haskell or Java). But we have to live with what we are dealt with, and FPC does for a matter of fact allow you to instantiate an abstract class, and also allows you to write code that ignores exceptions. Pascal is not a perfect language, who would have thought.
The difference is when you're using virtual functions, you have a clear "contract" (i.e. the method definition). When you throw an exception, you're just giving up. And it is not so bad until somebody starts to use it for another purpose e.g. to chop the whole call tree for example. And the worst thing is when somewhere in the middle the exception is just swallowed and didn't reach your code at all.
[/quote]
And with exceptions you have a "clear" contract through the exception definition. When an TCP connection class can throw an EConnectionClosedException, I as a programmer know exactly that to handle when a stream closes I just need to catch this specific exception. And all other exceptions I am not prepared to handle myself are thrown, they are not handled there. It's similar to a virtal/abstract class, where if you inherit from a class you can decide if you can handle certain virtual functions, or if you want to leave them as is and leaving it to the next class in the chain to implement them. And calling inherited is pretty equivalent to passing an exception along.
Again virtual methods and exceptions are the same idea, just in oposite directions. In one the chain is constructed bottom up, in the other one it's top down. Yet in both you delegate your execution to the first instance in the chain that registers a handler for it.
And still we're not talking about performance penalties, how correct is to transfer statuses through exceptions, multi threading complications, etc.
And this topic again..., first (especially windows SEH exceptions) are really fast, it's not much of a performance penalty, except that your CPU cache is invalidated. But aside from that, if you run into performance problems because of exceptions, we can talk, I have never seen that in reality. And if you do, and have millions of exceptions thrown each second, I agree, that are to many exceptions. But again, when is this ever a problem in a real application? I'm using exceptions quite a lot, and I have never run into performance problems because of them.
Also you are talking as if exceptions aren't a stable feature in all programming languages for the past 30 years. We know the problems and pitfalls quite well (e.g. you can't reraise exceptions across threads, simple as that)