Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Well, from my limited experience with Objective-C a few things made it hard.

The first is the traditional Cocoa pattern of a method that does useful things, which looks like this:

  - (void)beautifullyNamedMethodFor {
  	void* ugly_ptr_type; // and around 45 more
  	CFObscurePtrRef* .. = CFObscureObsoleteFunction(NULL, NULL,.....); // 56 arguments
  	// to the callback omitted for brevity
  	...*....(*foo)...->(*x++);
  	// and so one - with 45 lines of NULL ptrs passed as void* to CF calls
  	// juggled and incremented ad absurdum until your eyes bleed.
  }
So on the surface it's a beautiful Smalltalkish thing, while down below it's usually all hairy C, pointers and null-terminated strings and Core Foundation callbacks right out of MacOS 7 (especially if you want anything useful to be done that is not in Cocoa by default). This always seemed to me to be a deception in a way.

Another pet peeve of mine is the same agony of choice that is object variables (pointers versus values). When I want to return something or declare a variable, even when I am in the rose-tinted-glasses Cocoa world of beautifully-named methods, classes and keyword arguments I still have to put the dreaded death star in front of just the right things (and to remember NOT to put it in front of exactly proper other things).

So I guess for me the most problematic Objective-C part is the one that has to do with C (because it adds a level of complexities on top of C). The "Objective" part is actually very nice, once you get used to the call syntax and the brackets.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: