You don't always need a garbage collector to get a simple memory resource management
For example, if you extensively use smart pointers like tr1::shared_ptr, you can safely manage memory with familiar C++ concepts (like for example determistic destruction).
With tr1::shared_ptr, you call new() once and you don't need to worry about calling delete to release the memory. The smart pointer will take care of releasing the memory when the reference count goes to 0.
tr1::shared_ptr is part of the TR1 addition to the Standard C++ Libraries. TR1 will be released on top of VC++ 2008 very soon. Check out
vcblog for more info on this!
Thanks Ale (sorry for mis spelling your name in the previous post). True I forgot about the upcoming shared_ptr class (which my boost developer friends are going to kill me). I stayed away from the auto_ptr for various reasons in the past, but this looks
A question that may spark more (or be completely off base): In multi core/multiprocessor environments, what happens to the shared_ptr if you pass a reference to thread-B from Thread-C (which gained the shared_ptr's memory via
new) then thread-C dies. would thread-B still have access to the shared memory thus keeping the content in tact? or will it be destructed because thread-C is gone. Now im not 100% sure on windows, but the memory
location in some of those implementations (i.e. NUMA ) can be local to the processor and not in shared memory.
NOOO !!! I'm melting.... MELTING... What a world...
which brings me too..... F#, a very neat language which includes the best of all worlds !
well for the time being, I see myself still promoting C++ as my main code base for upcoming projects. I especially like the new MFC updates and the TR1 addins. I still cant find a replacement (framework) for application daemons that have to run 365 days....
in a small footprint (which is a reality for some developers).
Kate mentioned about services. In todays business world, SOA is used to describe everything and anything to do with business integration systems.
However we have many C++ webservice stub generators, which make it literally 5 minutes to develop a C++ webservice or webservice client. You dont need to write up your own crazy fast XML parser !
I must ask, what will be the point in moving from C++ -> C#/VB .NET when the next ISO C++ standard is released ? it will have a garbage collector to improve stability (hopefully). Sure the .net framework is excellent, but I can interop already with what I
want from it.
C++ at that point can become GC enabled or non GC enabled at a whim !
Again, I am a firm believer in the best tools for the solution.
The reason I chose VB here is because VB's language allows for the "Handles" declarator, and the language service generates handlers from those object/event dropdowns in the editor. It just made the example more streamlined -- didn't mean to imply that C#
didn't work, it just works differently.
Why not have that in the C# verison like in VS2005? I thought the idea was to add feature not take them away? That is something I do when I release bug fixes. I fix the bug, but break the code some where else. So, is it going to be the old way or the new way,
Why make VB *streamlined* and not C#.
Its in beta right now. you know what beta means correct ?
Does anyone know if managed C++ is being used in any production products?
Microsoft seems to be all but ignoring unmanaged development now, continually pounding out this "managed managed managed" mantra for C++. But I've yet to encounter anything but unmanaged in the wild, so I would be interested to see what managed is being used
I usually do not login to reply to this board, but I had to this time. (BTW I LOVE CHANNEL 9, I watch it everyday while I code in my igloo (I live in Toronto, Canada)).
I use Managed C++ in some of my applications that is part of a production system. The code is part of a communications application (cant tell ya more than that) that is originally written in UnManaged C++ ( I wont use the word legacy). I like the mix of
unmanged C++ and managed C++ together. For me, I will code in the right language/framework to completed the solution.
^ So do not be scared to try out a Managed / Unmanaged C++ combo together !
If you watch all the VC++ videos here on channel 9, you would know that Microsoft is not pushing "managed managed managed". I suggest you watch the video: