I use CamelCase for my funtions to reduce the danger a collision with toolbox functions of Matlab. For frequently used functions, compact names are nice. A leading "Calculate..." would introduce too much redundancy, because most functions calculate something. Compare:
CalculateMean(CalculateSin(CalculateLinSpace(0, 2*CalculatePI, 1000)))
mean(sin(linspace(0, 2*pi, 1000)))
How the output of a function is called, does not matter, when the function is called. Then the code of the function is not visible and the naming does not influence the usability.
Sometimes, I use the name of the procedure, sometimes the name of the output, and sometimes I add an initial "Set", "Get", "Write", "Read" etc. An example for different approachs:
MD5 = GetMD5(File)
MD5 = MD5Hash(File)
Hash = MD5(File)
Some fixed styles for choosing names of functions and variables are useful. But as long as you keep the overview and hte names do not get too long or too cryptic, it remains a question of taste. Then spending time and energy in the naming conventions is a wasted optimization.
On the other hand I'm using conventions for all names of variables:
- sulkingCamelCase for internally used variables, CamelCase for onput and output.
- All names in singular, trailing "List", "Vec" etc. if it matters, that they are arrays.
- Leading "is..." or "do..." for logical flags.
- "n..." is a number of elements or objects, "i..." is a loop counter.
This reduces the chance of e.g. confusing "nFile" and "nFiles" anywhere in the code. In opposite to this, I see less problems with confused names of functions.