Record Handling analysis
Record Handling by C.A.R Hoare introduced the notion of objects as records.
- Garbage collection through reference counting.
- References for compositing functional relationships.
- Dynamic allocation so objects can outlive their block.
- Create and Destroy procedures for creating objects (anywhere in the program) and removing them.
In modern C++ the record handling features above are possible.
|Garbage collection||std::shared_ptr||Built into the JVM.|
|References||std::shared_ptr||All objects are reference types.|
||All objects are dynamically allocated.|
|Create and destroy procedures||'new' and 'delete'||'new' provided but no explicit destroy procedure.|
C++ is prefereable to Java because not all objects require the record handling features. A large portion of programming does not deal with true "objects" in the sense that record handling denotes, therefore by using C++ and C we can efficiently control the machine and only optionally invoke the record handling features when required.