[geos-devel] GEOS Exceptions

Artem Pavlenko artem at pavlenko.uklinux.net
Mon Apr 18 14:47:52 EDT 2005


strk at refractions.net wrote:

>On Mon, Apr 18, 2005 at 01:09:06PM -0400, Mark Coletti wrote:
>  
>
>>On 4/18/05, strk at refractions.net <strk at refractions.net> wrote:
>>    
>>
>>>On Mon, Apr 18, 2005 at 11:16:45AM -0400, Frank Warmerdam wrote:
>>>      
>>>
>>>>Folks,
>>>>
>>>>I must confess I am not a particular advanced C++ programmer.  I
>>>>tend to avoid use of C++ exceptions, so now I find myself in a situation
>>>>where I am not quite sure what to do.
>>>>        
>>>>
>>>I really think this is a GEOS bug, in that it throws by pointer
>>>instead of by reference.
>>>I'm somehow happy to know you faced this so maybe you'll support a
>>>switch to a throw-by-reference-of-std::exception-derived, altought
>>>it will be a big API break.
>>>      
>>>
>>strk, didn't we have correspondence a while ago about this very issue?  I think
>>I supplied you with patches that would not only fix the
>>throw-by-reference-of-std::exception-derived implementation, but
>>patched the
>>dependent areas of the code.
>>    
>>
>
>We surely did, and I didn't apply them to avoid breaking the API.
>I hope they'll cleanly apply when we finally decide to do the break.
>(dependent areas are all client applications!)
>--strk;
>
>  
>
Hello, just to add my voice of support to Mark's comments. GEOS is long 
due for improvements IMHO.
Yes, in c++ you throw by value and catch by reference.
Yes, you can also throw by value and pointer and it is not a 'bug', but 
this is not good practice.
Yes these changes will require clients to add small modifications and 
re-compile, but I reckon there are lots of potential users out there who 
don't consider GEOS precisely because of 'bugs' like this.

The Open source community deserves something better then MFC, doesn't it?

These changes are trivial and must be applied now. This would give 
potential users confidence and speed up wider adoption of GEOS.

btw, I've done some work on WKT parser for my project (based on 
boost::spirit) and I'd like to share with GEOS if anyone is interested. 
I think it is a somewhat cleaner solution for the task.

Cheers!
Artem Pavlenko




More information about the geos-devel mailing list