|
|
|
|
|
by throwawayaway
4044 days ago
|
|
one of my favourite quotes from stroustrup says that 'don't use malloc and free, unless you want to debug 1980s' problems. which i find curious, given the truism about debugging and understanding code taking longer than writing code. personally i would prefer 1980s problems people in general know the answer to, rather than up to the minute esoterica. all that said, the scott meyers modern c++ book is out, so i should really start and finish that before forming an worthy opinion in 2015. |
|
>"says that 'don't use malloc and free, unless you want to debug 1980s' problems."
The problem with malloc and free is that they left to the developer to keep track of the references and memory corruptions bug are not pleasant to debug. RAII idiom actually helps a lot in that context, and that is what Strouptrup was referring to.