4 ms·
You should always know the signature of a function you're calling. Please be reading docs. The part I agree with are the method selection semantics. A good rul
by junon 6y ago
You should always know the signature of a function you're calling. Please be reading docs.
The part I agree with are the method selection semantics. A good rule of thumb (though don't rely on it) is that the "more specific" prototype generally wins.
- brown9-2 6y agoI agree you should know what you are calling when writing code, but there is also a need for people to read the code and understand what the behavior will be. My impression is that C++ relies a lot on implicit knowledge.
- vlovich123 6y agoAll languages do.
- Yoric 6y agoWell, many languages try to keep this minimal. C++ doesn't.
- ziml77 6y agoAnd it's nothing new with move/copy semantics either. Even passing by reference is bad for hiding that. Every time I write C++ I'm tempted to take pointers as parameters in places where you'd normally take a reference just so the call site has an indication of what I'm doing.
- junon 6y agoTotally agree.