I’m sure it’s unfair to call this a representational example, but it’s funny, so I’m sharing it. I haven’t actually used Objective-C before, so please don’t take this as anything more than a joke.
This is a segment of example code that Toodledo has in their API documentation:
Generating the signature with PHP
$key = md5( $userid.$myAppToken );
Generating the signature with Obj-C
char *cStr = [[NSString stringWithFormat:@"%@%@",userid,myAppToken] UTF8String]; unsigned char result[CC_MD5_DIGEST_LENGTH]; CC_MD5(cStr, strlen(cStr), result); NSString *sig = [NSString stringWithFormat: @"%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X", result[0], result[1], result[2], result[3], result[4], result[5], result[6], result[7], result[8], result[9], result[10], result[11], result[12], result[13], result[14], result[15]];
It kind of speaks for itself, doesn’t it?
3 comments
[…] before, so please don’t take this as anything more than a joke. This is a segment of… [full post] Jeff SectorFej techfunnyobjective-cphp 0 0 0 0 0 […]
It’s a sad fact that programming is now too complex – there is now far too many languages and scripting languages out there that if you devote 1 hour each day for each, there wouldn’t be enough hours in the day to lern them – obj-C example, who can remember all that,and type it in without an error? Is obj-c same as c++? Wouldbe surprised if they are different, and as for the php example, why is the function called md5? If we are not using an english type language, with english statements, I think that we should all be programming in machine code and have done with it!
Of course, you’re not comparing languages, you’re comparing libraries. But to most people, the “batteries included” libraries and frameworks *are* the language, and I think that’s a fair comparison to make. I’ve been programming for over 30 years, mostly C/C++/STL/Boost, python/perl/PHP, and I absolutely love Objective-C and Cocoa (touch). Just try writing a GUI app in PHP that looks as slick as an iPhone app and you’ll have an entirely different sort of posting reaching an entirely different conclusion