r/cpp • • Dec 29 '16

Garbage collection - No Thanks

http://www.modernescpp.com/index.php/garbage-collectio-no-thanks
0 Upvotes

5 comments sorted by

View all comments

2

u/JuanAG Dec 31 '16

If the cpp team has to spend 5 years to achive a GC and we lost features in the way of course i dont want any GC

But when the time comes it will be a nice feature, when all the new things get done this may be interesting, RAII works but it is not perfect, if you adquire a resource and in other part of the code happens anything you may have looked that resource until the next reboot and it is not that rare, all of us had this problem at least once. This will be the moment of the GC, something happened, you left the resource locked but your program still running, the GC will detect it and it will be free without any worries

Of course the GC should be optional (dont pay for what you dont use) to left the programmer to active it or not with a command like -allow_gc or similar

0

u/[deleted] Jan 08 '17

[deleted]

1

u/JuanAG Jan 08 '17

So you never left a file open and blocked? I doubt but if you say