Subject: Re: libssh2 master 942a40b... Call libssh2_error for every knownhost API failure.

Re: libssh2 master 942a40b... Call libssh2_error for every knownhost API failure.

From: Tor Arntsen <tor_at_spacetec.no>
Date: Fri, 26 Feb 2010 19:47:49 +0100

On Fri, Feb 26, 2010 at 19:26, Peter Stuge <peter_at_stuge.se> wrote:
>
> I'm unhappy with the proliferation of braces for single-statement
> cases. The comment above is also not to well placed IMO, but I find
> the many braces added in this commit to be a worse eyesore. :\
> Is there a coding style rule for this or simply your preference?

I for one prefer braces also for single-statement cases. It's an old
practice for avoiding later coding errors (inserting a new statement
w/correct indentation, but only noticing the indentation and not
noticing that there are no braces there. And sometimes it's not
obvious that there's just a single-statement line there to start with
if the statement is a multi-line call or something).

I work in a software development company and I've seen errors like
just described, it can easily happen in shops where the developers
just have to get the job done, and fast. So we now have in our company
coding style description that we _always_ use braces, we don't bother
with checking if there's currently just a single statement there yet,
or not.

Obviously when I code for libcurl (haven't really provided anything
for libssh2 yet) I of course follow the project style, which is no
braces for single-statement cases. But for open-source projects we of
course spend a little bit more time to avoid the mistakes ;-)

-Tor
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2010-02-26