Why People Don’t Like Objective-C

No Gravatar
Print Friendly

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 Post a comment

  1. Pingback: Why People Don’t Like Objective-C

  2. Chris

    January 18, 2011 at 7:00 am

    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!

  3. Bogatyr

    February 12, 2011 at 5:07 am

    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

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>