Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Speaking from a C++ perspective, the item pointed to may not be a simple type (like an integer) but a complex object.

Copying an object around all over the place (into functions, out of them) would be expensive. It would be like copying an entire ledger every time you wanted to make a change to the ledger. Far better would be to hand the ledger around, or when looking for it ask "where is it?" and be pointed to where it is now.

It also makes it simpler to make sure all your data is in one place, which is a good thing for program design.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: