There is a class of short living programs that are working this way:
1. Allocate some resources - memory, open files, etc.
2. Make some computations
3. Free allocated resources
4. Terminate
The same question is valid for the termination stages of long lived programs of the type:
1. Do some job
2. If not the end - goto 1
3. Free the resources still allocated
4. Terminate
Now, we know that the OS itself always cleans after the program termination. Is it really necessary to clean the allocated memory by our code, if it will be, with the same success, freed by the OS, one step further?
Can we safely omit the point 3 in the above examples? It is time and code after all.
Clarification 1: I am not talking about libraries where the code can be reused by someone in different context. I am asking about the finished programs, where the above structure is clean enough.
Clarification 2: The "good practices" are called so, because they are intended to prevent "bad effects". But if the bad effect is impossible to happen, are these practices still "good"? Or it is simply "tradition"?