Inclusion of `computer code` in a thesis During the compilation of thesis (MSc or PhD) in a case we wanted to include some program codes as chapters:

We prefer to put heading to all program codes everywhere they appear as complete source to clarify the license. Is it nice to do so? Any other solutions?

Something like this:


  3.1.1  Loop
    ...text...
    -------
    Copyright 2013 Coder, ...                   !this part
    -------
    function loop(...) result (...)
    some code
    -------
    ...text...
You should add source codes scarcely and when it is interesting to add the code. Loop does not sound one of the interesting headings. In those cases you should include source code as figures and discuss them in your text. 

in other cases, you can give complete source codes in appendix or in a CD/DVD as an attachment.