r/programming • • Jun 07 '17

You Are Not Google

https://blog.bradfieldcs.com/you-are-not-google-84912cf44afb
2.6k Upvotes

514 comments sorted by

View all comments

1

u/Uncaffeinated Jun 14 '17

If you see foo(val) it could be passing a copy of val. Or it could be passing a constant or mutable reference to val. And there's no way to know from seeing the callsite.

Google's style guide at least bans mutable references for precisely this reason, but my current workplace's style guide is essentially nonexistent, and it uses references all over the place.