All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Smith <smithbone@gmail.com>
To: linux-fbdev-devel@lists.sourceforge.net
Cc: "Alexander E. Patrakov" <patrakov@ums.usu.ru>
Subject: Re: New driver: s3d2xfb
Date: Wed, 28 Sep 2005 07:50:32 -0500	[thread overview]
Message-ID: <8a0c3678050928055020971433@mail.gmail.com> (raw)
In-Reply-To: <433A88A0.2080906@gmail.com>

>>       if (!cnt) {
>>               save_s3(info);
>>       }

> You don't need to enclose a single statement with "curly braces".

I'm not trying to start any kind of flameage here but my curiosity was
just tweaked by that statement.

What do you like about single line if's over ones with {} that leads
you to advocate their usage?  You've obviously got loads of experience
with a large amount of code written by other people so I'm interested
in your opinion.

Feel free to take it off list if you think its too OT.

I deal with a lot of beginning programmers that go to the University
of Arkansas.  In many of the texts that I see now on introduction to
coding the emphasis is on rules that deal with consistency.  Not using
{} on every if block regardless of the size violates that rule.

I use linux in embedded systems and when I bring up linux on a new
system I sometimes have to pepper a driver with printks to see what's
not working right.

"one liners" are used in many places throughout the driver code and I
always end up going back and adding the {} so that I can add printks.

So IMHO "one liners" are an something of an annoyance. *grin*

--
Richard A. Smith


-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl

  reply	other threads:[~2005-09-28 12:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-28 10:46 New driver: s3d2xfb Alexander E. Patrakov
2005-09-28 12:12 ` Antonino A. Daplas
2005-09-28 12:50   ` Richard Smith [this message]
2005-09-28 13:16     ` Antonino A. Daplas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8a0c3678050928055020971433@mail.gmail.com \
    --to=smithbone@gmail.com \
    --cc=linux-fbdev-devel@lists.sourceforge.net \
    --cc=patrakov@ums.usu.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.