Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Methods for understanding complex, real world, C++ code?
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Scott Lurndal  
View profile  
 More options Apr 17 2012, 11:24 am
Newsgroups: comp.lang.c++
From: sc...@slp53.sl.home (Scott Lurndal)
Date: 17 Apr 2012 15:24:09 GMT
Local: Tues, Apr 17 2012 11:24 am
Subject: Re: Methods for understanding complex, real world, C++ code?

Ian Collins <ian-n...@hotmail.com> writes:
>On 04/17/12 02:06 PM, Scott Lurndal wrote:
>> Miles Bader<mi...@gnu.org>  writes:
>>> Pavel<pauldontspamt...@removeyourself.dontspam.yahoo>  writes:
>>>>> Real namespaces are better than "glued on" adhoc namespaces because
>>>>> they allow _either_ explicit references or implicit [with "using"]
>>>>> references, and that choice is in the hands of the user [of the
>>>>> namespace] where it belongs.  The appropriate choice can differ,
>>>>> for the same namespace, depending on the context of the use.

>>>> Well, because "explicit" references are possible without namespaces,
>>>> the only feature they are adding seems to be allowing to use the
>>>> "implicit" ones.

>>> That doesn't mean one always has to use that feature.  However the
>>> _ability_ to use that feature is important.

>>>> By mentioning of "write-only" code in my original answer I was trying
>>>> to make a point that "more choices" is not necessarily equivalent to
>>>> "better". Specifically, "more choices" provided by namespaces may be
>>>> desirable for code writer but be rather hurtful for reader.

>>> "More explicit" names are not always "more readable," and can often be
>>> _less_ readable, because the constant repetition obscures what's
>>> actually meaningful.

>> I'd disagree with this.   Without namespaces, an unqualified variable
>> is scoped local to the member function or is a class member (static
>> or not).   It may be a global static if the coding guidelines allow such
>> a thing (good ones don't).   By explicitly qualifying any other identifier,
>> one is instantly aware of where it is stored and/or defined.   Using
>> namespaces (no pun intended) obscures that and makes understanding the
>> code more difficult.

>Not really, consider code with lots of io.  Does us look clearer with
>"std::cin" and friends or with a using directive and "cin"?'

I will admit that none of the projects I referred to below used C++
I/O.   Nor did any of them use STL (for performance reasons), even tho
STL was created by one of my employers.

>Provided your naming conventions differ for namespaces and types (all
>those I've used do), differentiating between a static class member and a
>namespace scoped variable is straightforward.

>> None of the C++ projects that I've worked on (two operating systems,
>> a hypervisor, two full system simulators and a major CA's certificate
>> generation code) used namespaces, nor did most of them allow any
>> unqualified statics, which are almost always problematic in threaded
>> or re-entrant code.   Of course, all of the above must be thread-safe
>> and re-entrant for proper operation.

>Where these recent projects?  It took a while for namespaces to be
>widely used after they were introduced in the '98 standard.

About half before, the other half after.   However, since none of them
used STL (see above), namespaces weren't that useful.

scott


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.