[postgis-devel] STYLE

Paul Ramsey pramsey at cleverelephant.ca
Fri Dec 19 08:47:23 PST 2008


The ansi requirement unfortunately makes this worse:

if ( this )
{
  then = that;
}
else
{
  those = them;
}

BTW, the reason I spec'ed ansi is just because it seems to be the
majority of the existing code base. What comes out of my hands
unconciously is kr.

if ( this ) {
  then = that;
}

On Fri, Dec 19, 2008 at 7:41 AM, Obe, Regina <robe.dnd at cityofboston.gov> wrote:
> Alright if you like it perhaps I was a bit too harsh and that isn't the one
> that bothers me the most. How about this concession.
>
> //OKAY
> if (!binary) free(v);
>
> //NOT OKAY
> if (!binary)
>   free(v);
>
> //NOT OKAY
> if (!binary) free(v); printf(...);
>
>
> The issue I have with the NOT OKAY is that its too easy for a python
> programmer or some other language that relies on indentation to screw this
> up.
>
> -----Original Message-----
> From: postgis-devel-bounces at postgis.refractions.net on behalf of Mark
> Cave-Ayland
> Sent: Fri 12/19/2008 10:34 AM
> To: PostGIS Development Discussion
> Subject: Re: [postgis-devel] STYLE
>
> Obe, Regina wrote:
>
>> 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.
>
> Aaargh - I really like this and use it a lot :(
>
> The convention is fairly easy to read: if there are no {}s then only the
> next statement is considered part of the if... or else... clause. Does
> that help at all?
>
>
> 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.
>
> ________________________________
>
> Help make the earth a greener place. If at all possible resist printing this
> email and join us in saving paper.
>
> _______________________________________________
> postgis-devel mailing list
> postgis-devel at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-devel
>
>



More information about the postgis-devel mailing list