I am writing my master of science thesis and I am not sure whether I should add some of the code I have written: they are not proper programs, but more like input files to be fed to a commercial program (Nastran) very popular in my field.
My concerns are related to the fact that I am not making any discovery, just applying the things I have learned reading the manual. Still, I feel the code will make the effort I put into the thesis to also learn this language clearer.
Answer
My take on this -- in a physics PhD -- was that code that had a bearing on the results should be included in the appendix. I read in the entire source of my data-processing routines (using the listings package in LaTeX) and included them.
But I skipped bits like 40 consecutive lines of assigning defaults to variables (0s for later incrementing) or writing a default config file:
(check the line numbers in the example) This is easy to do in listings, as is setting monospaced fonts and code highlighting.
I'm not saying this is the right way of doing it, just a sensible way. I may not even have implemented this approach as well as I could have done.
Of course, this will depend on your field. In my case the code was an important processing step in the results of some tricky new experiments. No-one is realistically going to want to replicate my code, checking some aspects of it is another matter. And yes, I do have every intention of making it available as well -- but it would be of limited use given that my coding style could at best be described as "scientist, self taught in Python".
No comments:
Post a Comment