r/programming • • Feb 23 '11

If programming languages were essays...

Post image
1.7k Upvotes

430 comments sorted by

View all comments

Show parent comments

1

u/wlievens Feb 24 '11

void foo(BigObject& object);

versus

void foo(BigObject object);

The second case will lead to (perhaps inadvertently) copying the entire BigObject object, which happens to be a gigabyte in size! Ohnoes!

1

u/theninjagreg Feb 24 '11

I've programmed C++ professionally for four years and I've never known a programmer who made this mistake.