Someone suggested here to use the bundle key from the entity into - this is just overdose for me.
Someone suggested to use devel - but this will display the node type only when you via the UI and not progrematiclly.
When using a node, or any other entity, when you know that the type the key you can use it as you suggested - just use the $node->type. Another thing you can use is the entity metadata wrapper which is a helpful tool - you can access field and properties the same way but it's also contain some good function:
$wrapper->getBundle() in order to get the type of the entity($node->type).
$wrapper->label() in order to get the title of the entity($node->title, $user->name).
$wrapper->getIdentifier() in order to get the ID of the entity($node->nid, $user->uid) and many other functions.