When to use `getExecutionCode` and when `execute`?
As you may know Animation Nodes creates a python script based on your node tree. So each node has to provide some code that goes this script. 

The execute function is fairly easy to use and should be prefered when you have a static amount of sockets and when the execution code does not change when you change some properties of the node.

The getExecutionCode function is called every time the node tree is changed. So it can return different code depending on some sockets. Also it avoids the function call overhead which can be noticable when you execute a node thousands of times.

In general you can write most nodes in both functions, there is no clear separation when to use what. I suggest you start writing nodes using the execute function.

btw: the getExecutionCode function will be generated automatically based on the sockets if the node has a execute function.

I hope that helps a bit, feel free to ask more detailed questions about the code. But maybe it would be better to ask them on github, not sure...