[postgis-devel] STYLE

Obe, Regina robe.dnd at cityofboston.gov
Fri Dec 19 07:22:06 PST 2008


This I mentioned to Mark offlist, but since its sort of a STYLE issue I thought I would restate it here.

I know C programmers are in love with doing this short-cut.  

if (!binary) free(v);

I hate it.  It drives me crazy because its too prone to error when someone comes
by and tries to stuff another statement in there and forgets to put the bracket in.

Can we add to style guide to use the more verbose convention

if (!binary){
   free(v);
}

Thanks,
Regina


-----Original Message-----
From: postgis-devel-bounces at postgis.refractions.net on behalf of Mark Cave-Ayland
Sent: Fri 12/19/2008 6:52 AM
To: PostGIS Development Discussion
Subject: Re: [postgis-devel] STYLE
 
Paul Ramsey wrote:

> http://svn.refractions.net/postgis/trunk/STYLE
> 
> This is not meant to be the last word, it's just a draft, please add
> your changes as you see fit (you in particular, Mark).
> 
> On a related note, as I work with liblwgeom, I wish we had more API
> documentation than the header file... I think doxygen will work fine
> w/ C. should we commit to doxygen as our in-code standard?
> 
> P.

This looks entirely sensible, nice work Paul :)  I think at some point 
we should just add a script to the repo that will indent all the .c/.h 
files (excluding those used to generate .sql.in files) and run it as we 
hit RC. Doxygen is something I've not personally used, although I've 
used equivalents for PHP etc. Have you got any example files in trunk I 
could run it on to take a look?

BTW I noticed your r3450 commit, and this got me thinking. One of things 
that really trips me up at the moment is LWCURVE - why oh why was it not 
called LWCIRCSTRING??! This tends to trip me up a lot, since SQL-MM 
defines a curve as a LINESTRING or a CIRCULARSTRING and so makes the 
logic a lot harder to follow when trying to map SQL types to C types.

So would anyone really object if I performed another massively invasive 
substitution to get this out of my system for once and for all on trunk? 
I promise not to break the build ;)


ATB,

Mark.

-- 
Mark Cave-Ayland
Sirius Corporation - The Open Source Experts
http://www.siriusit.co.uk
T: +44 870 608 0063
_______________________________________________
postgis-devel mailing list
postgis-devel at postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-devel




-----------------------------------------
The substance of this message, including any attachments, may be
confidential, legally privileged and/or exempt from disclosure
pursuant to Massachusetts law. It is intended
solely for the addressee. If you received this in error, please
contact the sender and delete the material from any computer.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-devel/attachments/20081219/bd406a9d/attachment.html>


More information about the postgis-devel mailing list