So I got into the whole idea of learning plain TeX (or what I think is plain TeX) and it's been very fun and rewarding. I also started writing some macros/packages for my personal use for now. Since for the main document I (still) use LaTeX as well as lots of high level packages, it really doesn't matter if the packages I write are written in plain TeX, plain LaTeX or use
etoolbox, etc... But I'm wondering:
What is good practice for package writing? Especially if I want to distribute that package one day. On the one hand, plain TeX is more powerful, much more portable and static (the output will not change in time or across different compilers). On the other hand, it's more prone to mistakes due to the programmer (me) not fully understanding all the subtleties in the general usage case. One example would be the robustness of commands, but I'm sure more experienced folks can give many more examples of rookie traps.
If I do use LaTeX in the package, what are the advantages and disadvantages of relying on extra packages such as
Also, how can I know for sure (without digging through the files that came with my distribution) if a plain old command is a TeX primitive or a LaTeX kernel command - is the case that ALL LaTeX kernel commands have at least one
@and no TeX primitives have that? Is it ok if inside the package I mix TeX with some of those LaTeX kernel commands? (I'd assume they're pretty stable and don't change much across versions?)