[Tex/LaTex] Naming conventions for macro names that include the package name

macrosnamingpackage-writing

Background

Many packages provide commands that have the full name of the package, or an abbreviation, as part of the command name. Sometimes the package name (or abbreviation) is at the beginning of the command name, and sometimes it is later. For example, many packages provide a settings macro. Sometimes this is of the form \set<pkg><param> while in other cases we have \<pkg>set<param>. An example is \setbeamercolor vs. \pgfsetarrowoptions. I believe both pgf and beamer were created by the same author. There are also cases where a package provides a command that does something similar to a built-in command, and thus has a similar name. So we have variants of \input in the forms of \VerbatimInput from fancyvrb and \inputminted from minted.

Question

When the name of a command includes the name of the package (or an abbreviation), are there any conventions for where the package name occurs? I'm primarily thinking about macros that are for the user, rather than internal macros or macros for package writers. Are there advantages to having the package name at the beginning of the command name, versus having the package name later, or is it just a matter of personal preference? Are there reasons to prefer one approach to the other?

Reflections

I can think of some possible reasons that each approach might be beneficial. Putting the package name (abbreviation) first gives a nice uniformity to command names, so it might be beneficial when there are a lot of commands to name (pgf might be an example). At the same time, putting the package name later might result in commands that sound more like natural language or sound more active, and thus might be easier to remember (in the \input case, we want a particular kind of \input).

Best Answer

Personally, I prefer a suffix

\getthemacro@cx \andaddto@cx \checkthereadabilty@cx 

and compare

\cx@getthemacro@cx \cx@andaddto \cx@checkthereadabilty 

for the user maybe GetTheMacro if you follow LaTeX2e conventions, which to be honest I am not very fond of...

Personal preference I guess, and is doomed to disappear if and when I move onto LaTeX3, which has a standard convention.

Related Question