Re: Recommended style
From: Joona I Palaste (palaste_at_cc.helsinki.fi)
Date: 12/30/04
- Next message: Andrey Tarasevich: "Re: Recommended style"
- Previous message: Andrey Tarasevich: "Re: const function() !!??"
- In reply to: Alan Balmer: "Re: Recommended style"
- Next in thread: xarax: "Re: Recommended style"
- Reply: xarax: "Re: Recommended style"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 30 Dec 2004 18:50:13 GMT
Alan Balmer <albalmer@att.net> scribbled the following:
> On 30 Dec 2004 18:00:21 GMT, Joona I Palaste <palaste@cc.helsinki.fi>
> wrote:
>>Lawrence Kirby <lknews@netactive.co.uk> scribbled the following:
>>> On Thu, 30 Dec 2004 03:14:26 -0400, The Dragon wrote:
>>>> Alex wrote:
>>>>> how about
>>>>>
>>>>> if((fp=fopen(filename,"mode"))==NULL)
>>
>>> That's a clear, concise C idiom, but please locate your space bar.
>>
>>I realise I'm treading on religious issues here, but I have a strong
>>rule about spaces before the first opening paranthesis. "Strong" as in
>>"written in stone".
>>The rule consists of two parts:
>>1) If the statement starts with a keyword (such as "if", "for", "while"
>>etc.) then include *ONE* space.
>>2) If the statement starts with a function or macro name then include
>>*NO* spaces whatsoever.
>>This rule applies to both C and Java.
>>
>>I am amazed how many people either break one of the above parts, or even
>>worse, switch them around.
> Why would you be surprised that someone would violate *your* rule? I
> didn't even know about it until now. (And, to tell the truth, still
> don't feel any particular obligation to conform to it.)
Bad choice of words. With "this rule" I really meant "a similar rule". I
don't expect people to know I have written this rule in stone. I am
reasonably sure most people have come up with a similar rule on their
own, or if not, work the same way anyway. After all, keywords are like
normal English words, and you add a space after English words. OTOH,
functions are not English words, they're more like mathematical
functions, and I don't think people leave spaces between mathematical
functions and an opening paranthesis.
-- /-- Joona Palaste (palaste@cc.helsinki.fi) ------------- Finland --------\ \-------------------------------------------------------- rules! --------/ "All that flower power is no match for my glower power!" - Montgomery Burns
- Next message: Andrey Tarasevich: "Re: Recommended style"
- Previous message: Andrey Tarasevich: "Re: const function() !!??"
- In reply to: Alan Balmer: "Re: Recommended style"
- Next in thread: xarax: "Re: Recommended style"
- Reply: xarax: "Re: Recommended style"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]