Objective-C: Good and Bad
Good
Lighweight
Simply preprocessor and small runtime
Syntax sugar over C, easy to learn
Runtime
Completely dynamic message sending.
 Don't need inheritance to call a method
 with different objects
True introspection. Allows to watch class
  hierarchy, check if an object has a
  particular invariant or implements some
  method, call a method by name
Categories and Proxies
Allows addition of methods to another class
Even a class you don't have source for
Also allows overriding of existing methods
Key Value Coding/Observing
Bind string names with object invariants at
  run-time
Call back when the value of some invariant
 is going to be / was changed
Self-contained objects
Objects tend to be handful and smart
 enough to be used standalone
#import
No include guards or “#pragma once”
 anymore
[NSBundle classNamed]
Create a class by name, which could be
 used later to instantiate objects
Blocks
Closures are awesome
Allows to define a block of code with
  surrounding context and pass it to other
  function
Facilitates concurrency
Bad
Syntax
Lots of square braces. Compare:
  [[[MyClass alloc] init:[foo bar]] autorelease]
  MyClass.alloc.init(foo.bar).autorelease
Keyed parameters: difficult to reorder them
 during refactoring
Lighweight
The same code has to be repeated often
Little language support for anything other
  than message sending
Folks could say “because there's no magic”.
 But more code means more bugs
Without Cocoa this “no magic” would be
 absolutely awful
Memory Management
Half-manual, half-automatic
Raw pointers are evil
No garbage collector
Reference counters overhead
Migration to automatic reference counting
 takes time
Allocation and Initialization
Which are two separated operations
 MyClass *object = [MyClass alloc] init];
Multiple constructors work via designated
 initializers without any language support
self = [super init]; //assignment to self :(
  if (self)
  {
    //init invariants
  }
  return self;
No Stack Objects
Dealloc won't be called automatically
Messaging nil
Does nothing and hides real bugs
Wouldn't be so bad if it were easy to make
 messaging nil scream
Cocoa messages nil as a matter of course
Overriding and Overloading
Categories are broken: overriding a method
 more than once leads to undefined
 behavior
No method overload. Need to mangle
 names manually
No Namespaces
Not a major gripe, but It's real handy
Id should be id *
Not clear:
 NSString *foo = @”foo”;
 id bar = foo;
Better:
 NSString *foo = @”foo”;
 id *bar = foo;
So So
Frameworks
Could be a problem, if Cocoa wasn't the
 best one publicly available
Type Safety
Can't catch lots of errors during the compile
 time
But allows its awesome runtime features
Questions?

Objective-C: Good and Bad