How to Write a Program/Enhancing code
Usually create variables that will represent certain data types that you want to represent or simulate in your program in comparison to the particular problem needing to be solved or real world simulation-i.e. the basis for your program
Then create or use function/methods that you want your program to preform in order to achieve a specific tasks or real world simulation.
This is usually done in block methods or modules, in which you encapsulate or wrap all necessary data (representations) and methods (and arguments/parameters) into an object / class, which best simulates the basis of what the program is supposed to represent...this is turn is called generating code.