How to Format Code in Research Reports
- by RoseOfJericho
I am currently writing a formal research report, and I'll be including code with this report.
Question: Is there an accepted way of displaying code in research reports? I'm thinking both in terms of font, spacing, et cetera, and whether the code should be displayed inside the document, or in an appendix.
The code will be JavaScript and PHP. None of the sections of code will be more than 25 lines (so they're mere snippets). There will be approx. half a dozen snippets. Each of the snippets will have a couple of paragraphs explaining what is happening in the code, and a discussion on its pros/cons.
I have no contact with the body the report will be submitted to, and they have no published guidelines on how to format code (please do not question these points).
Any help considered and appreciated.