What does this code do in magento ?
$customer = $this->_getCustomer();
this code in createPostAction in customer/accountController .
Why put underscore "_" in most of Method
This function gets the current user data. @return Mage_Customer_Model_Customer
I believe functions with _ at the start are private. Public functions do not have an underscore.
The underscore prefix is part of the Zend Framework 1 coding standards (and thus the Magento 1.x coding standards) that every private or protected method or property name should start with an _
.
This goes back to the php version 4 days, when there where objects but only public visibility.
Nowadays with php5 there is no real reason to proliferate this convention, except that it is part of the Magento coding standard.
_
is nothing special here.