[Qt-interest] Configure QtDesigner ui.h

Danny Price deepblue842 at googlemail.com
Fri Sep 2 22:51:38 CEST 2011


On 2 Sep 2011, at 21:31, Scott Aron Bloom wrote:

> Not at all… auto_ptr doesn’t leak, yes, it has been deprecated and replaced by unique_ptr, but there is no harm in using it in compilers that support it…

The problems with auto_ptr are well documented so I will not re-iterate them here. It's like goto; useful in certain situations but better off avoided. The fact that it has been deprecated by the standard speaks volumes.

> Boost doesnt solve memory issues.. IMO misusing it causes them J

No using bald pointers causes memory issues, even for experienced programmers. auto_ptrs cannot be safely passed around.

> But saying, you will have memory leaks is if you don’t use boost, is like saying you will have memory leaks if you don’t use Qt.  Complete Hogwash

Really? I've found memory issues with code written by very experienced but overconfident developers. It's all too easy to leave a hanging or uninitialized pointer.

I used to work for a company that had to be forced into the 21st century. They used Visual SourceSafe 5, didn't see the value in upgrading from VC6, they refused to allow us to use even STL never mind boost! Their reasoning was that they didn't want to introduce unwanted dependencies. Even the Qt application we were developing had to be kept separate from the business logic. 

I spent most of my time fixing memory issues caused by bald pointers as opposed to adding value to the product, a very expensive and wholly avoidable policy for them.

>  
> From: Danny Price [mailto:deepblue842 at googlemail.com] 
> Sent: Friday, September 02, 2011 1:17 PM
> To: Scott Aron Bloom
> Cc: qt-interest at qt.nokia.com
> Subject: Re: [Qt-interest] Configure QtDesigner ui.h
>  
> I hope they enjoy their memory leaks :)
>  
> On 2 Sep 2011, at 20:56, Scott Aron Bloom wrote:
> 
> 
> Not using boost is actually very typical from many of my clients…
>  
> While the install overhead is not trivial.  It doesn’t “check into the repository” easily is another… 
>  
> Its free in cost, but not in overhead..
>  
> Also, IMO opinion, its coding style scusk.. sorry.. If boost was written using a Qt style coding style, ie easy to read and code to.. I might be able to convince more people…
>  
> But I can say, I have never lost a client because I push and advocate Qt.  I would have if I did for boost.
>  
> Scott
>  
> From: Danny Price [mailto:deepblue842 at googlemail.com] 
> Sent: Friday, September 02, 2011 11:40 AM
> To: Konstantin Tokarev
> Cc: Scott Aron Bloom; qt-interest at qt.nokia.com
> Subject: Re: [Qt-interest] Configure QtDesigner ui.h
>  
>  
> On 2 Sep 2011, at 19:33, Konstantin Tokarev wrote:
> 
> 02.09.2011, 22:23, "Danny Price" <deepblue842 at googlemail.com>:
> 
> 
> Then you've been giving your clients very bad advice indeed. auto_ptr is deprecated in C++0x and a failed design. Do not use it.
>  
> Use boost::scoped_ptr,
> 
> Obviously requires Boost :)
> 
> And you can't use boost because...? Seriously it's free and an single installer away. The advantages of the shared pointer and hash classes alone outweigh any downsides and works across platform, providing tr1/2 features where they might not exist (OSX).
>  
> std::unique_ptr
> 
> Requires C++0x
>  
> Or boost (boost::scoped_ptr = std::unique_ptr)
> 
> 
> 
> 
> 
> 
> or a similar managed pointer.
> 
> QScopedPointer
> 
>  
> I didn't mention the Qt pointers because they seem to have issues with forward-declared classes. MSVC doesn't complain but GCC warns that virtual destructors will NOT be called. I don't trust them.
>  
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at qt.nokia.com
> http://lists.qt.nokia.com/mailman/listinfo/qt-interest
>  

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110902/54ea24c0/attachment.html 


More information about the Qt-interest-old mailing list