How to build an engine?

Hey,
I believe this would be the proper place to put this.
Does anybody have any tips on how to build an engine. For example, how do you (meaning you specifically, I believe everyone does it differently) set up classes, what naming conventions do you use for variables/functions, how do you comment your code, what do you do for your planning stages and any other relevant things you can think of that are used in general engine making.
Thanks,
beano