Hacker News new | past | comments | ask | show | jobs | submit login

If a function takes a pointer parameter, then you have to think about if it is pointing to one object or an array.

If it is passed by reference I'd be less inclined (personal opinion) to think the reference is stored somewhere, while a pointer argument might be saved somewhere for some time.

A function invocation with reference looks the same as a function invocation with value, so on a quick glance, someone might think that the parameter will remain unchanged.

It is easy to convert a pass by value to a pass by reference (just put const &, vs changing all dots to arrows with pointers) to speed up a slow copy of a large object, so I may get the impression that that was the reason for using a reference when reading the code.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: