POV-Ray : Newsgroups : povray.beta-test : Beta 37 and C++0x : Re: Beta 37 and C++0x Server Time
2 Jul 2024 15:32:05 EDT (-0400)
  Re: Beta 37 and C++0x  
From: Warp
Date: 30 May 2010 16:03:11
Message: <4c02c47f@news.povray.org>
clipka <ano### [at] anonymousorg> wrote:
> Am 30.05.2010 16:44, schrieb Warp:

> >    That's quite a lot of information that a simple 'std::' is conveying. More
> > importantly, the 'std::' prefix is making the line a lot more unambiguous
> > because you know you don't have to look where the definition of 'equal()'
> > might be, as you know it's a standard function. Hence the code is much
> > easier to understand more quickly and with less work.

> I dare to disagree: I think it may make code more readable in some way, 
> but at the same time make it less readable in some other way.

  I honestly cannot understand exactly what is it in 'std::' that would
make code "less readable". Exactly how does it make the code less readable?
Is someone going to get confused because there are some 'std::' prefixes
before some names? Exactly what kind of confusion does this cause? (As I
already said, the prefixes *remove* confusion and ambiguousity rather than
adding them, and that's pretty easy to demonstrate, as I did.)

  I have seen people opposing the usage of the 'std::' prefix for years,
and so far I have seen zero rational reasons for that.

> Readable != Readable. It depends whether you want to analyze in-depth 
> how code /exactly/ does things, or whether you want to get a general 
> overview of what the code does.

  But that's the whole point: The 'std::' prefixes make it a *lot* easier
to get a quick understanding of what a piece of code is doing. It makes it
both visually and contextually clear and unambiguous when a standard function
or type is used, and hence no time needs to be spent in figuring out what
exactly a name is referring to.

  You make it sound like omitting the 'std::' prefixes would actually help
in "getting a general overview of what the code does", or in other words,
using them would make it more difficult to understand the code at a glance.
Exactly what do you base this on?

  The 'std::' prefixes are both a clear visual clue which helps seeing
quickly that something in the standard library is being used, and they
also provide more in-depth information if you know what that function or
type does, without having to start guessing whether it's something from
the standard library or from somewhere else.

> Making consequent use of namespace 
> prefixes helps for the former, but I guess it won't do too much good (if 
> at all) for the latter, as for that purpose it just adds more 
> information to digest when browsing the code; to a casual browser, it 
> isn't important whether the smart_ptr is a std::smart_ptr or a 
> boost::smart_ptr.

  So in your own words, the *worst* case scenario is that the 'std::'
prefixes don't add anything informative to the casual viewer. Which would
mean that they aren't actually harmful at all.

  So given its benefit, and given that there are no disadvantages, why
would one want to omit them?

> Warp, I think you're oversimplifying, as you often do (though you're not 
> alone in that).

  Oversimplifying what exactly?

-- 
                                                          - Warp


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.