For comparisons / evaluations of objects of the same class(and other purposes), is it better to define a static or a non-static (is this called "dynamic" by chance?) function?
Sample code:
class student
{
internal decimal medianOfMarks()
{
int count = 0;
decimal sum = 0;
foreach(float mark in reportCard)
{
counter++;
sum += mark;
}
return sum / count;
}
**OR**
internal static decimal medianOfMark(student delinquent)
{
[same logic]
}
}
Let's not consider making the function a property, though parameterless, since I'd like an answer applicable to parameterized functions as well.
What are arguments pro / con each approach?
What deciding factors do exist?
I've already thought into this myself, but I don't want to bias the discussion with my opinion.