On Mon, Mar 31, 2008 at 12:50 PM, Joe Hourcle
<[log in to unmask]> wrote:
> On Mon, 31 Mar 2008, Ed Summers wrote:
>
> > FWIW, I agree with Karen and Alexander. The whole point (to my
> > recollection) of creating code4lib in the first place was to create a
> > venue where any aspect of computer programming in libraries could be
> > discussed. To my mind, this includes licensing, and business models,
> > and whether you like K&R style.
>
> I _cannot_stand_ K&R style -- it's for people who count 'lines of code'
> using 'wc -l'. I much prefer KNF.
>
I agree, but there are two important additions I'd like to make:
First, use of tabs. In modern software development, all tabs should be
spaces. (vim users: set expandtab in your .vimrc).
Second, there should be no parentheses around the value passed to
return: return 4, not return (4);
Third, empty lines - if used sparingly - are ok even with a method body.
- Godmar
|