traits, interface, inheritance

Prefer interface to inheritance
use trait for inheritance
If have to use inheritance, use abstract class

is_a => interface

has properties => composition (traits, mixins)

template pattern => abstract class implements interface

inheritance is outdated, should be avoided these days


It’s a convenience macro to save you typing nonnull in your headers. From the Swift blog detailing how new safety features have been incorporated back in Objective-C:

To ease adoption of the new annotations, you can mark certain regions of your Objective-C header files as audited for nullability. Within these regions, any simple pointer type will be assumed to be nonnull.

See Nullability and Objective-C –