There are 2 different ways to create a new content type programmatically.

* First one, which I also use, is to create it in your custom module's `.install` file in [`hook_install()`](https://api.drupal.org/api/drupal/modules!system!system.api.php/function/hook_install/7) using [`node_type_save()`](https://api.drupal.org/api/drupal/modules!node!node.module/function/node_type_save/7) and attaching the fields also in [`hook_install()`](https://api.drupal.org/api/drupal/modules!system!system.api.php/function/hook_install/7) with [`field_create_field()`](https://api.drupal.org/api/drupal/modules!field!field.crud.inc/function/field_create_field/7) and [`field_create_instance()`](https://api.drupal.org/api/drupal/modules!field!field.crud.inc/function/field_create_instance/7) .
* The second one, which in [Node Example](https://drupal.org/project/examples) module is used, is to create it in your custom module's `.module` file using [`hook_node_info()`](https://api.drupal.org/api/drupal/modules!node!node.api.php/function/hook_node_info/7) and creating and attaching the field instances in [`hook_node_type_insert()`](https://api.drupal.org/api/drupal/modules!node!node.api.php/function/hook_node_type_insert/7)

I am preferring the first method, since my feelings say that is better to maintain (i.e. adding/updating new fields via [`hook_update_N()`](https://api.drupal.org/api/drupal/modules!system!system.api.php/function/hook_update_N/7)) and it suits better in `.install` file. But, I keep myself asking why it is done other way in Node Example module.

Does anyone know the CONs and PROs of using both methods to create a new content type in code?