4 ms·
What I like about C is that one can easily tell if something is passed by value or not, because I know these things won't be modified. C++ does not have this pr
by jstimpfle 5y ago
What I like about C is that one can easily tell if something is passed by value or not, because I know these things won't be modified. C++ does not have this property, because C++ has (non-const) references - so when reading code one always has to check the signature of the called function.
On the other hand, C sometimes nudges you to pass by pointer where semantically you want a copy. Well, Matrix4x4 is the only example I can think of right now actually, and here I usually just bite the bullet and pass a copy, which might be a little wasteful but whatever (copying 64 bytes is not the end of the world, and the code might actually be inlined). And here, C++'s const-references can be an improvement to the situation.