Author: Kevin Lawton

# Coding Guidelines For Bochs

- Don't make use of any external C++ classes. They are not offered on all platforms and this would make bochs non-portable. There is use of such classes in the optional debugger. I plan on removing this use.
- Don't use fancy C++ features. Bochs is incredibly performance sensitive, and will be increasingly so as more speed enhancements are added. There's a time and place for most everything and this is not it. Some advanced features create overhead in the generated code that you don't see. They also convolute the code, and sometimes occlude what is really going on.
  - Don't use templates.
  - Don't use virtual functions.
  - Don't use C++ exceptions.
  - Don't use overloading of any kind.
- Use soft tabs. At least when you submit code, convert all hard tabs to spaces. There is no uniform way to handle tabs properly.
- Prefix screen spew with a pound sign ('#'). If you want to spew something out to the screen rather than the bochs.out file, send it to stderr (not stdout), and prefix the string with a pound sign. This is so that a text interface which drives bochs (the debugger) can discern between messages and command responses.
- Please do compile with all warnings turned on. It's really difficult to spot interesting warnings when a compile is littered with non-interesting ones.
- Don't use signed ints where unsigned will do.