POV-Ray : Newsgroups : povray.beta-test : Beta 37 and C++0x Server Time
4 Jul 2024 18:50:58 EDT (-0400)
  Beta 37 and C++0x (Message 31 to 40 of 77)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>
From: Edouard
Subject: Re: Beta 37 and C++0x
Date: 31 May 2010 18:40:00
Message: <web.4c0437ece947f53b3925073f0@news.povray.org>
"Fredrik Eriksson" <fe79}--at--{yahoo}--dot--{com> wrote:

> Why does the POV-Ray code blindly import whole namespaces anyway? There is
> a reason why 'using namespace' statements are considered poor practice.
> [...]
> Fully qualifying each and every reference to
> 'shared_ptr' (thank you, "Replace in files") of course fixes this
> particular problem.

I have to respectfully disagree - "using" statements, including "using
namespace", is not considered bad practice by everyone. Many experts feel that
"using" statements are in fact good engineering practice.

The beauty of the internet is that you can find as many experts as you want to
agree with any side of an argument.

I would argue that fully qualifying all types is much worse practice. Namespaces
are designed to manage these problems, otherwise you'd just embed all
definitions in a class called "std" instead. Namespaces give you more
sophisticated tools than your editors global find and replace dialog.

Cheers,
Edouard.


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: Beta 37 and C++0x
Date: 1 Jun 2010 00:03:53
Message: <4c0486a9@news.povray.org>
On 01.06.10 00:00, Edouard wrote:
> For now, you could try putting the following switch in the "C++ Command Line"
> additional options field:
>
> /D_HAS_CPP0X=0
>
> That should suppress the TR1 features in the Microsoft headers, as it seems it's
> not quite the time to move away from the Boost implementation of those features
> just yet.

Cool, I was looking for this but could not find it at any logical place (to 
me) in the MSDN VC2010 documentation that is online. Do you have a reference 
where to find it? Strangely, googling for "D_HAS_CPP0X" returns no results - 
yet I thought all VC 2010 docs are online (I still have 2008, so i can't 
check offline docs).

	Thorsten


Post a reply to this message

From: Nicolas Alvarez
Subject: Re: Beta 37 and C++0x
Date: 1 Jun 2010 00:17:53
Message: <4c0489f1$1@news.povray.org>
Thorsten Froehlich wrote:
> On 01.06.10 00:00, Edouard wrote:
>> /D_HAS_CPP0X=0
> 
> Cool, I was looking for this but could not find it at any logical place
> (to me) in the MSDN VC2010 documentation that is online. Do you have a
> reference where to find it? Strangely, googling for "D_HAS_CPP0X" returns
> no results - yet I thought all VC 2010 docs are online (I still have 2008,
> so i can't check offline docs).

/D is a command-line switch. The macro is called _HAS_CPP0X.

http://www.google.com/search?q=_HAS_CPP0X


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: Beta 37 and C++0x
Date: 1 Jun 2010 12:41:14
Message: <4c05382a$1@news.povray.org>
On 01.06.10 06:17, Nicolas Alvarez wrote:
> Thorsten Froehlich wrote:
>> On 01.06.10 00:00, Edouard wrote:
>>> /D_HAS_CPP0X=0
>>
>> Cool, I was looking for this but could not find it at any logical place
>> (to me) in the MSDN VC2010 documentation that is online. Do you have a
>> reference where to find it? Strangely, googling for "D_HAS_CPP0X" returns
>> no results - yet I thought all VC 2010 docs are online (I still have 2008,
>> so i can't check offline docs).
>
> /D is a command-line switch. The macro is called _HAS_CPP0X.
>
> http://www.google.com/search?q=_HAS_CPP0X

Ah, I have to admit I never used the command-line define of VC. Thanks for 
the pointer!

	Thorsten


Post a reply to this message

From: Warp
Subject: Re: Beta 37 and C++0x
Date: 1 Jun 2010 14:22:31
Message: <4c054fe6@news.povray.org>
Edouard <pov### [at] edouardinfo> wrote:
> Many experts feel that
> "using" statements are in fact good engineering practice.

  Experts of what? At least not in programming C++, that's for sure.

> I would argue that fully qualifying all types is much worse practice.

  It would be interesting to hear those arguments.

-- 
                                                          - Warp


Post a reply to this message

From: Warp
Subject: Re: Beta 37 and C++0x
Date: 1 Jun 2010 14:29:58
Message: <4c0551a6@news.povray.org>
Thorsten Froehlich <tho### [at] trfde> wrote:
> On 01.06.10 00:00, Edouard wrote:
> > For now, you could try putting the following switch in the "C++ Command Line"
> > additional options field:
> >
> > /D_HAS_CPP0X=0
> >
> > That should suppress the TR1 features in the Microsoft headers, as it seems it's
> > not quite the time to move away from the Boost implementation of those features
> > just yet.

> Cool, I was looking for this but could not find it at any logical place (to 
> me) in the MSDN VC2010 documentation that is online. Do you have a reference 
> where to find it? Strangely, googling for "D_HAS_CPP0X" returns no results - 
> yet I thought all VC 2010 docs are online (I still have 2008, so i can't 
> check offline docs).

  I'm curious to know what is your solution to all the other compilers which
are implementing features of the upcoming C++ standard. Will you find such
preprocessor macros in all of them and add them to the project? Are you going
to keep blaming the compilers for implementing the new standard?

  And what happens when the upcoming standard gets ratified and suddenly all
those compilers become standard (and hence you can't blame them anylonger)?
What if some of those compilers stop referring to "CPP0X" or alike, once
again breaking the compilation?

  That solution is, simply put, a *kludge* to get around a design problem
which would have a very clear and clean solution.

  After all, it's perfectly *ok* for there to exist a class named "shared_ptr"
inside the 'boost' namespace *and* the 'std' namespace. That's exactly what
namespaces exist for. If you pull everything out of those namespaces and
suddenly get naming collisions, the problem is not in the libraries. The
problem is in your code. It's the code which is broken. The libraries are
doing nothing wrong.

-- 
                                                          - Warp


Post a reply to this message

From: clipka
Subject: Re: Beta 37 and C++0x
Date: 1 Jun 2010 14:52:48
Message: <4c055700@news.povray.org>
Am 01.06.2010 20:29, schrieb Warp:

>    I'm curious to know what is your solution to all the other compilers which
> are implementing features of the upcoming C++ standard. Will you find such
> preprocessor macros in all of them and add them to the project? Are you going
> to keep blaming the compilers for implementing the new standard?

Keep cool. If that's really something you're genuinely worried about, 
then you should stop talking and start helping. If you're just curious 
about it, you might get some answers if you changed to a more neutral 
mode. But if you're just into accusing others of doing the things wrong 
that they do, please stop your ranting and - pardon my french - shut 
your cake-hole.

If people don't do things the way /you/ want them to be done, then it's 
/you/ who's making a mistake - by just standing at the side and giving 
smart advice instead of getting your hands dirty yourself.


Post a reply to this message

From: clipka
Subject: Re: Beta 37 and C++0x
Date: 1 Jun 2010 14:57:32
Message: <4c05581c$1@news.povray.org>
Am 01.06.2010 20:22, schrieb Warp:

>    Experts of what? At least not in programming C++, that's for sure.

In case you don't notice: You're currently treading on the feet of many 
who are contributing to POV-Ray. Please, by all means, switch to a less 
destructive mode or - beg your pardon - STFU. You're addressing people, 
not programming robots!


Post a reply to this message

From: Warp
Subject: Re: Beta 37 and C++0x
Date: 1 Jun 2010 15:46:47
Message: <4c0563a7@news.povray.org>
clipka <ano### [at] anonymousorg> wrote:
> Am 01.06.2010 20:22, schrieb Warp:

> >    Experts of what? At least not in programming C++, that's for sure.

> In case you don't notice: You're currently treading on the feet of many 
> who are contributing to POV-Ray. Please, by all means, switch to a less 
> destructive mode or - beg your pardon - STFU. You're addressing people, 
> not programming robots!

  Maybe if someone would finally produce some rational arguments why the
current usage of 'using namespace' should be kept and the problems kludged
around with some compiler-specific precompiler macros.

  People say "it would reduce readability/maintainability", "many experts
advocate the usage of 'using' statements". Could some rational arguments
explaining these claims be given?

-- 
                                                          - Warp


Post a reply to this message

From: Warp
Subject: Re: Beta 37 and C++0x
Date: 1 Jun 2010 15:48:02
Message: <4c0563f1@news.povray.org>
clipka <ano### [at] anonymousorg> wrote:
> Keep cool. If that's really something you're genuinely worried about, 
> then you should stop talking and start helping.

  Removing the 'using namespace' statements and adding the namespace
prefixes is mechanical work that could be done relatively easily
(especially if the compiler tells you where you have to put them), even
if it would take some time with a program of the size of POV-Ray.

  The problem is that some people involved in the project oppose this
idea. Hence such work might not be accepted.

> If you're just curious 
> about it, you might get some answers if you changed to a more neutral 
> mode. But if you're just into accusing others of doing the things wrong 
> that they do, please stop your ranting and - pardon my french - shut 
> your cake-hole.

  I have explained with rational arguments why removing the 'using namespace'
commands and using the namespace prefixes would be a good idea for all
kinds of reasons. I have seen no rational arguments against this suggestion,
only baseless claims (along the lines of "it would reduce maintainability",
with zero reasons or arguments why this would be so).

  Instead, Thorsten has suggested using really ugly kludges to get around
the problem, such as making POV-Ray not compile at all if the C++ version
is too new, or to use compiler-specific precompiler macros to turn off
the conflicting features. This, ironically, from the same person who argues
pro maintainability.

  Since nobody has presented any rational arguments why the 'using namespace'
statements should be kept, I see no logical reasons to keep them. But of
course stubborness and resistance to change (and perhaps pride) are stopping
this from being done, and instead some ugly compiler-specific kludges are
suggested instead.

  And your answer to this is "shut your cake-hole". Right.

> If people don't do things the way /you/ want them to be done, then it's 
> /you/ who's making a mistake - by just standing at the side and giving 
> smart advice instead of getting your hands dirty yourself.

  Please suggest how I could "get my hands dirty" in this case. Thorsten
is actively opposing the proper solution, so it's not like I could just go
and do it. At least not until he changes his mind.

-- 
                                                          - Warp


Post a reply to this message

<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>

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