I think that the main issue are not the pointers themselves but the that
when using pointers you might easily loose track of who owns the pointer.
On my job nowadays I use mostly higher level languages, or what is called
modern C++, and I am surely glad never to worry about dangling pointers
anymore.
On my area you have to deal with huge projects with several teams scattered
around the globe, and it was always a very stressful situation to
fix pointer related issues, with Customer pressure wanting a fix for
yesterday, while trying to find which module was to blame for the problem.–
Paulo
On Thu, Jan 7, 2010 at 2:15 PM, Anthony T. <goumba_tony at yahoo.com> wrote:
julien CLEMENT wrote:
So one should avoid stl containers just
because it’s not a good practice to put pointers inside them ?By all means I’m an intermediate programmer at best, however I’ve never
quite understood this logic myself.I fail to see the difference between a container of pointers and an array
of pointers.Yes, if you fail to delete the pointers yourself, there will be a memory
leak.C style arrays do not clean up after themselves. Fail to delete the
pointers, and again, you will have a memory leak.So, this “good practice” to me is nothing but nonsense.
However, I am an intermediate programmer at best, and just adding my $0.02.
Far better programmers than me would agree its bad practice.–
Anthony T.Only two things are infinite, the universe and human stupidity, and I’m not
sure about the former. – Albert Einstein
SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org