Skip to content

Instantly share code, notes, and snippets.

@beccadax
Last active February 19, 2017 08:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save beccadax/351682b8cc2ee4cc3ada76aaf42d4479 to your computer and use it in GitHub Desktop.
Save beccadax/351682b8cc2ee4cc3ada76aaf42d4479 to your computer and use it in GitHub Desktop.

The problem with Metatype as a keyword is that it's one level of abstraction too far up.

Think about a typical type name: Int, UIViewController, Record. What you'll notice about the type name is that it's a description of the instances of that type, not a description of the type itself. You don't see types with names like IntStruct or UIViewControllerClass except in beginner code.

Just as UIViewController is a class, UIViewController.Type (to use current terminology) is a metatype. But that doesn't mean the word "metatype" belongs in its name, any more than the word "class" belongs in UIViewController. The type name describes the instances of that type, and the instances of UIViewController.Type are types, so Type, not Metatype, is the appropriate word.

That's why I say that we should use Type<T>, not Metatype<T>—because Metatype<T> would have the same mistake as UIViewControllerClass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment