incubator-stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Travis Vitek" <Travis.Vi...@roguewave.com>
Subject RE: spacing suggestion for new code
Date Fri, 27 Jun 2008 16:15:50 GMT

Martin Sebor wrote:
 
>Eric Lemings wrote:
>>  
>> 
>>> -----Original Message-----
>>> From: Martin Sebor [mailto:msebor@gmail.com] On Behalf Of Martin Sebor
>>> Sent: Thursday, June 26, 2008 5:21 PM
>>> To: dev@stdcxx.apache.org
>>> Subject: spacing suggestion for new code
>>>
>>> While reviewing all the new code that's been added I'm finding it
>>> difficult to spot where one namespace-scope definition ends and
>>> another starts because the spacing between them (the number of
>>> newlines) is the same as the spacing between members, namely 1
>>> blank line. I find code easier to read when namespace scope
>>> definitions of functions and classes that span more than one
>>> line are separated by two blank lines.
>>>
>>> Existing code likely isn't completely consistent in this regard,
>>> and I'm sure examples of both styles could be found, but I'd like
>>> to think the two-line style is prevalent. Either way, in the
>>> interest of readability, I'd like to suggest that we adopt the
>>> two-line spacing style for all new code. Yes?
>> 
>> That's my general preference as well.  I prefer to use two lines to
>> separate unrelated logical groups.  If the groups are related, I'll use
>> 1 line to separate them.  Within a logical group, I do not use any blank
>> lines.
>
>Your rule sounds a bit more complex than what I'm suggesting.
>Determining what logically belongs together requires an
>understanding of the definitions. What I'm looking for is
>a purely visual clue to help me tell one namespace-scope
>declarative region (mostly just class or function definition)
>from another.
>

Should either scheme apply to linkage specifiers?

Personally, I like the flexibility to use zero lines in some places...

  // i prefer this...

  _RWSTD_NAMESPACE(__rw) {
      struct __rw_whatever_type;
  } // namespace __rw

  // as opposed to this...

  _RWSTD_NAMESPACE(__rw) {


      struct __rw_whatever_type;


  } // namespace __rw

As long as the number of lines of whitespace doesn't outnumber the number of lines of 'code',
I'm fine with using multiple lines of whitspace. Other than that, I don't really have a preference.

Travis

Mime
  • Unnamed multipart/mixed (inline, None, 0 bytes)
View raw message