Best practice: main code for controllers

Hi, I’m curious if anyone can comment on where they put the main code for each controller. Do you just put it in the body of the controller or do you put it in ionic before enter or after enter?

Any best practices?

Thanks.