I'm a beginning researcher trying to write a research paper , so please bear with some of the really basic questions I might have. I've already looked around for some help online, but the websites I found were vague.

My program is written in perl. Should I include my code in the paper? If so, is there a maximum number of lines? Will people expect me to include all of it in the paper (either in the appendix or in the body) or can I just write out in text the general idea of what it does?


3 Answers 3


In general, I would never include code in the "main" paper outside of computer science or applied mathematics. There are very few cases where listing code explicitly would actually improve the quality and readability of the paper. If it is necessary to include the code, I would do so as part of the "Supporting Information" which many journals allow you to include alongside the main publication. I would then describe the features of the code as words in the main text.

Even in CS and math papers, I would still only put pseudocode in the main article, and would save any listings of actual code for the Supporting Information.


Well, I have been writing papers for nearly a decade. And I have never seen anyone including source code in any publication (except in dissertations). Everyone prefers to include a well defined algorithm section in the paper. I think there would/could be two (or more) reasons behind this:

  1. The (main and related) codes are lengthy and take a lot of space in your paper that could otherwise be used for something else.
  2. Everyone who would read your paper might not very good at programming in the language you chose. For instance, maybe I include an FFT script in MATLAB, and it is possible the readers are more interested to see it in Python or C etc. So, in this case adding a code would not add a lot of value in your paper. Therefore, I normally say that the pseudocode language is more universal.

The norms and expectations for including code as supporting information vary across fields.

Personally, I would include your code as a supporting information. This allows others to recreate your work. See resources and references I cited in an answer to a previous question on a similar topic.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .