Tag Info

New answers tagged

0

Naming functions (regardless of complexity) can be tricky, especially when trying to keep them concise. I would simply go with objectOrEmptyStringIfNull, which is concise. What I would recommend, regardless of what you name it, is just to also add a comment for future reference: //function to return proper value or empty string if null - (NSString *) ...


2

Some languages such as Java have “static methods” that live in a class's namespace, but do not use dynamic dispatch. Instead, they are dispatched statically at compile time (hence their name). Dynamic dispatch is less efficient than static dispatch, since we have to search for the method in all classes of the object we're calling a method on. A central point ...


1

You have to mock or emulate, and you have two very good reasons to do so. First of all, you have to mock or emulate whatever parts of the system your code interacts with, precisely because you don't want to alter the system, and you don't want your tests to depend on something as uncontrollable as the system. Yes, your emulation will not be perfect; yes, ...



Top 50 recent answers are included