There are two concepts which are routinely confounded in beginning and procedural programming - the decomposition of the problem into simpler subproblems and the call stack
( Read more... )
8. Classes often have normal locations; a class whose instances are normally allocated high-on-the-stack (long lifetime) has a different feel than a class whose instances are normally allocated low-on-the-stack (short lifetime), and both of those are different than classes intended to be allocated on the heap (lifetime based on the data rather than the static structure of the code).
Comments 1
8. Classes often have normal locations; a class whose instances are normally allocated high-on-the-stack (long lifetime) has a different feel than a class whose instances are normally allocated low-on-the-stack (short lifetime), and both of those are different than classes intended to be allocated on the heap (lifetime based on the data rather than the static structure of the code).
Reply
Leave a comment