In mathematical scientific papers, which section would I detail pseudo code or sample source code? Would that be included in an Appendices section or above under Methods?
- How long is it?
- If short put it in the paper
- If long put it in the appendix
- Can your paper stand with-out it?
- If so, then it is supplementary, so goes with the supplementary materials, i.e. in the appendix
- If not, then it needs to be in the paper.
If it is both Long and Required, then perhaps you are writing overly detailed pseudocode. I know the formal pseudocode I learnt in high school was detailed to the point of being executable -- which defeats the purpose of pseudo-code -- if it can be written clearly in a language that is in common use in your area (E.g. R for statisticians, Matlab for signals engineers) you can just write it in that language and avoid any ambiguity.
If on the other hand it is short and not required, it can go anywhere (Possibly even in a footnote). Though its still not required.
A common pattern, I've seen a few times is to have pseudocode, or just textual descriptions of the algorithm in the main text. Then an implementation in a real programming language in an appendix; And/Or a footnote linking to the authors website/github where it can be downloaded
The most important deciding factor is your reason for wanting to include the pseudo code.
If the code is meant to make understanding the paper easier, then by all means include it in the main body of the paper. For instance, if you described a method for solving a certain problem, but then you want to give a more precise and succinct description in the form of the pseudo code, then the reader will want to see it as soon as he reads about your method. As a special case, if the code is essential to your argument, you should definitely include it in the main body. Depending on the level of complication, you might either want to put it in the introduction (if it's very short) or later on.
On the other hand, if the code is meant to just make precise things that the reader already knows, then it's best deferred to the appendix. For instance, suppose that you are writing a pure mathematics paper, and you employed the computer to check some standard (but tedious) estimates for you. Then you might want to include the code so that the inquisitive reader can check that you got all the technicalities right, but most people will be more than happy to never have to look at them.
As a rule of thumb, put things in the appendix if (and only if) you expect an average reader will not want to see them. This could be for a variety of reasons, the most important of which are a) the material is standard, and included for the sake of completeness, b) the material is technical, and reading though it actually makes it harder to understand what's going on (unless one already has a good grasp of the main ideas).