I wonder what prefix you guys use for methods that create or calculate a value based on given parameters. I tend to use “get”, but that feels wrong, because it looks like a getter then.
For methods that fetch from the database I use “fetch”, but for methods that create a value based on the given input I haven’t found a satisfying prefix yet. (“create” feels a bit too generic). Are there guidelines for this or is everyone just thinking up something for themselves?
Pseudo code example:
class myClass
{
method getOrderFlowpoint(par1, par2, par3) {
// do stuff based on the parameters
return orderFlowpoint;
}
}
I tend to not use prefixes. I tend to name the method according to the exact function it fulfills.
If your function calculates the order flowpoint, that’s exactly how you should name it.
calculateOrderFlowpoint.