Would a LaTeX glossary contain program function/method purposes/definitions?
A glossary is


a list of terms in a special subject, field, or area of usage, with
accompanying definitions.
such a list at the back of a book, explaining or defining difficult
or unusual words and expressions used in the text.


so the wrong place for extended descriptions of what your functions do.
Whether those descriptions belong in the text where the function is used or in a separate section with links from the text depends on more context than you can provide here. Imagine  the readers of your thesis, knowing what they know (but not what you know) and think about what would best help them follow your argument.
LaTeX can easily manage the cross referencing with a custom \newtheorem command.
Ask your advisor for advice.