4 ms·
C++ is filled with hidden input. The identity of the this pointer is hidden from the execution of the function. The identity of the function to be executed is
by ajross 15y ago
C++ is filled with hidden input. The identity of the this pointer is hidden from the execution of the function. The identity of the function to be executed is hidden from the caller. If that's really your requirement, then you're using the wrong language, the ship sailed.
I agree with mistercow: default arguments are, on the whole, a Good Thing. Think of them as a restricted form of overloading which requires (much!) less code to be written.
Obviously they can be misused, but again, that's the nature of programming (and especially of C++). Sane default argument conventions make code easier to read and write.
- haberman 15y ago> The identity of the this pointer is hidden from the execution of the function. Your argument makes no sense; the "this" pointer is just a function parameter, and the whole point of a function is that the arguments aren't fixed until the function is called. No part of this is implicit. > The identity of the function to be executed is hidden from the caller. The function is named at the call site along with all input to that function (unless you use default arguments). This also is not hiding: every part of the function and its input is explicit. Much better arguments for your case would be overloaded operators and implicit conversions, both of which happen without an explicit information at the call site. But it's no coincidence that both of these are forbidden by the Google Style Guide also.