When I write the following sentence, the grammar/spelling checker running on my Mac always suggests me to use prefixed to or prefaced with.
Functions implemented by a module should always have their names prefixed by the module name.
What I mean is that, if the module name is user, the function name should not be load()
, but user_load()
.
Is it correct to use prefixed by, or should I use another phrase?
Best Answer
Both prefixed to and prefixed by are correct, but they have different meanings.
If A is prefixed to B, A is the prefix and B is what the prefix is added to. In this case the end result is A_B. To use your example, you could say that
user
is prefixed toload()
to createuser_load()
.If A is prefixed by B, B is the prefix and A is what the prefix is added to. The result is B_A. For your example, you would say that
load()
is prefixed byuser
to createuser_load()
.To state this in more general terms for your entire project, you might make either of these statements:
And concerning the sentence in your question:
It is indeed correct, because the suffix (function name) is prefixed by the prefix (module name).