September 2019
Intermediate to advanced
352 pages
8h 3m
English
Topic 26 | How to Balance Resources |
To light a candle is to cast a shadow...
We all manage resources whenever we code: memory, transactions, threads, network connections, files, timers—all kinds of things with limited availability. Most of the time, resource usage follows a predictable pattern: you allocate the resource, use it, and then deallocate it.
However, many developers have no consistent plan for dealing with resource allocation and deallocation. So let us suggest a simple tip:
| Tip 40 | Finish What You Start |
This tip is easy to apply in most circumstances. It simply means that the function or object that allocates a resource should be responsible for deallocating it. Let's see how it applies by looking ...
Read now
Unlock full access