How do I programmatically create a new content type?
If I were you, I would consider using the Features module. The module enables exporting a subset of websites structure into a single feature to facilitate re-using this feature elsewhere.

Also, Features module enabled exporting content types/fields easily, you would just tick a certain content type and Voila! The Features module will generate Drupal hooks for you, and also export the code into a module.