Re: Future of C++
On Aug 12, 11:03 am, peter koch larsen <peter.koch.lar...@gmail.com>
wrote:
More difficult in what way? I believe that all current code with
manually managed memory will continue to work in gc C++. Thus, the
effort will not be greater than if the library designer generated code
for the current version of C++. Of course, the designer now has to
face a dilemma: will he write only for gc C++ and risk losing
customers (namely the segment that continues without gc) or will he go
the whole way and perform manual memory-management? Luckily, I see no
reason not to supply a library for gc only in order to later - if
demand requires so - add the manual memory management without any
implications for existing users.
This presumes that it is possible to build a library for gc-only, then
change it later to follow auto-deletion model, with little consequence
to either the library code, or the code that uses the library code.
From my experience, the whole GC-Or-No-GC argument is not so trivial
as "adding gc or leaving it out."
The mindset of the programmer must be established when determining
whether to use gc versus not, and this mindset heavily influences the
style an architecture of any related code. Changing a library from gc
to no-gc will undoubtedly break something.
Each time I have ever had to "help" someone fix their gc-related bugs,
it has never been something trivial, like forgetting to iniatialize a
variable, forgetting to close a handle, or not applying a mutex in
multi-threaded application. Typically, the entire application is a
mess, and most strikingly, that which they are trying to effect -
deterministic disengagement of a resource - is precisely that which
they forsook when they subscribed to gc model.
-Le Chaud Lapin-
--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]