Note: This answer is outdated, and does not reflect the current behaviour of the Stack Exchange software. Since January 2019, the MathJax environment is limited to every individual post instead of the complete question-and-answer thread. As such, the concerns voiced in this answer are no longer a problem.
Absolutely not. Absolutely not.
In fact, \renewcommand
really shouldn't be used at all.
Why? Because the title, question, answers, and comments on a page are not in separate MathJax environments. If you use \renewcommand
(or even \newcommand
, though that's not quite as bad) you risk clobbering others' contributions. All of a sudden their text will be rendered differently from what they were shown in the preview.
Even if you check that no one else has used the command, you've silently altered the MathJax environment for any future posters. Imagine the frustration from a user unfamiliar with this feature when faced with their answer giving rendering errors in one place that are not reproduceable elsewhere.
\renewcommand
in a multi-user, evolving environment is the equivalent of re#define
ing key parts of a language in a public header file. Anyone who loads the file will be unknowingly using your personal variant of the language rather than the standard one.
If you want \ket
to have some particular meaning, the first step is to have this as a MathJax package (I don't know whether or not this exists), and the second step is to convince the SE team to automatically load this package on physics pages. The other option is to have the team somehow implement MathJax in isolated environments, one per post. (I don't even know if this is feasible.)
Otherwise, a little verbosity never hurt anyone. Besides, I'm not sure adding another layer of obfuscation via macros is the best way to help newcomers learn a language. It seems more like giving them a fish ("here, just use this header; don't ask what's in it") than teaching them to fish.
On the side, I don't think the proposed definition of \ket
is itself bad (aside from the erroneous use of |
rather than \lvert
...). It's just that this sets a precedent for others to develop more and more complicated macros, probably just copying and pasting from an ever-growing file of personal preferences with more and more ways to potentially break things.