All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gerrit Renker <gerrit@erg.abdn.ac.uk>
To: dccp@vger.kernel.org
Subject: [RFC]: field name identifier conventions
Date: Sat, 20 Oct 2007 15:54:35 +0000	[thread overview]
Message-ID: <200710201654.35326@strip-the-willow> (raw)

I have a question/suggestion for DCCP/CCID field names, which have a tendency to grow
into really_quite_long_strings. The convention for field members seems to be


	"x"->"x"_<fieldname>

Examples are in particular

   * hctx->ccid2hctx_<fieldname>
   * hcrx->ccid3hcrx_<fieldname>
   * avr->dccpavr_<fieldname>
   * av->dccpav_<fieldname>

The problem is that this naming convention has no apparent benefits: 
  
  * which struct is used is evident from the context and need not be encoded
  * someone reading the code is only interested in the fieldnames
  * with the line length limit of 80 characters this convention almost inevitably leads to
    multi-line expression for even the simplest kinds of comparisons and expressions.

Hence my suggestion is to reduce the replicated "x" field prefix, so that field members become
shorter, as will be expressions, and the code would be easier to read.

What is the opinion of other developers / maintainer regarding this? 



             reply	other threads:[~2007-10-20 15:54 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-20 15:54 Gerrit Renker [this message]
2007-10-20 21:03 ` [RFC]: field name identifier conventions Arnaldo Carvalho de Melo
2007-10-20 21:08 ` Arnaldo Carvalho de Melo
2007-10-21  1:56 ` Ian McDonald
2007-10-21  2:54 ` Łeandro Sales
2007-10-22 11:20 ` Tommi Saviranta
2007-10-22 14:50 ` Gerrit Renker

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=200710201654.35326@strip-the-willow \
    --to=gerrit@erg.abdn.ac.uk \
    --cc=dccp@vger.kernel.org \
    /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.