[fpc-pascal] Re: using exceptions

Marcos Douglas md at delfire.net
Wed Jan 4 14:13:31 CET 2012


On Wed, Jan 4, 2012 at 9:56 AM, Lukasz Sokol <el.es.cr at gmail.com> wrote:
> On 04/01/2012 12:47, Marcos Douglas wrote:
>
> [i see I hit on the obvious so: cut]
>
>>
>> I agree with you! But I was discussing the possibility do not using
>> Exceptions. ;-) Another point is when and where uses Exceptions...
>> that's what they were discussing.
>>
>> Marcos Douglas
>
> Well I think there is this choice:
> - either do use exceptions and exception handling, thinking of it
> as your way of /optionally/ implicitly returning error code from
> inside a routine, i.e. your 'way to return another value from function'

That is the default way.

> - or (if possible by compiler switches) disable exception handling code
> and handle all exceptions by hand. Or just don't use it, so it can be
> optimized out. Implies that you have to be prepared for every corner case
> in your error-paths as well.

This is a good idea for code that needs extreme performance.
Even you use "ErrorCode returns" approach in your code, the RTL,
Lazarus, etc still use Exceptions and you have to live with they.

>
> As far as I see there is no third way. Or is there? :)

I guess not.

Marcos Douglas



More information about the fpc-pascal mailing list