3 ms·
It can be useful when there is a piece of functionality that could be or not be present depending on the configuration. Something like a debug logger that is n
by ainar-g 4y ago
It can be useful when there is a piece of functionality that could be or not be present depending on the configuration. Something like a debug logger that is nil in a release build or some OS-dependent feature handler that is only non-nil on that particular OS. I do admit, though, that that might be confusing for people coming from languages like C++, where calling methods of null pointers is almost always an error.