I “ported” thorncp’s fsck to objective-C this week. fsck lets you tell the compiler how you really feel.
Disclaimer: Although fully functional, this is a joke / prank project. Do not actually use it in production.
Convenience constructors got you down? Just
//give me a freaking array NSMutableArray *myArray = [NSMutableArray giveMeAFreakingArray];
for(int i = 0; i < 10; i++) { NSNumber *myNumber = [NSNumber hateBoxingNumberWithInt:i]; [myArray addTheFreakingObjectOrElse:myNumber]; }
[myArray enumerateThesePointlesslyBoxedObjectsUsingUnreadableBlockSyntax:^(id obj, NSUInteger idx, BOOL *stop) { NSLog(@"%@",obj); }];
NSLog(@"%@",[@"Hello, world!" thisDescriptionIsAwesome]);
All you have to do is add NSObject+fsck.m to the project. I am completely serious. You don’t have to touch a single file. Just be sure to check it into source control over lunch, when they won’t notice…
Short version, fsck deletes random words from your method invocations until it finds a method matching the signature.
Long version, fsck hooks into forwardInvocation:
, which is similar in spirit (but much more complicated) than Ruby’s missing_method
.
Sound good? Get it from GitHub.
Comments
Comments are closed.