In the context of programming a function is a sub-routine that on input produces output or side effects defined by an algorithm. Functions are used to structure a program and to encapsulate smaller tasks.
Since functions make typically sense only in the context of a specific programming language, the function tag should be used together with a tag indicating the programming language.