/ unboxing of primitive types • collection operators like sum/avg/max, removing need to write them • more complex operators like unionOfObjects • can be applied to sub-objects eg. @sum.price • extracting only interesting attributes
Automatically pick up classes implementing specific protocol. • Intercept methods to log or modify behavior eg. Aspects. • Implement similar functions without repetition: • eg. findBy{Field} • Store context data per instance.
it more readable or avoiding clutter, eg. • KZAsserts automatic NSError generation, assertions and graceful error handling with same line of code. • KZPropertyMapper implements compile time error checking, generates custom bindings, removing need for breakable code. • Testing/Mocking frameworks
turns into @"name" • Generate unique symbols by joining: NSString *local_##param = #@param; turns into NSString *local_name = @"name"; • Use gcc expression extension to execute few statements: ({ result = doSomething(param); result; })
misspelling of keyPaths/ properties: ({if(NO){ [self param]; }; #@param;}) np. Macro(name) will return NSString* for a keyPath but only if it exists, compile error otherwise.
• Cleaner and more robust code • Easier to evolve • Fun! • With great power comes great responsibility: • Design with care • Any programming technique can be misused