# Question in obfuscated code

This question (source (code) of second revision) is written in bizarre obfuscated code. I am referring to the code, not to what you see when you read the question. One cannot help suspect some kind of sarcasm on the part of the poster. Should this be condoned?

Here is the code:

$\def\p{\varphi}\def\l{\langle}\def\r{\rangle}\def\v{v_1}\def\w{v_2} \def\a{ \l u,v \r}\def\q{\p(u)}\def\b{\q = \a}\def\c{\l u, \v \r} \def\d{\l u, \w \r}\def\e{\q=\c=\d}\def\f{\v-\w}\def\g{u=\f} \def\h{0 = \c - \d = \l u , \f \r}\def\i{\f=0}\def\j{\v = \w}$


This was placed into the middle of a sentence written in English, interrupting it. It is intended to produce this result: $$\varphi(u) = \langle u,v\rangle$$

• Looks like good ol' plainTeX macro definitions. The poster prefers to write \p in place of \varphi et cetera, and first defines the needed macros. I used those a lot before I was forced to switch to LaTeX. I bet that the macro definitions were copy/pasted from a private source. – Jyrki Lahtonen Jul 9 '14 at 20:01
• But they're interspersed with the sentence written out in English and with each other in a way apparently intended to make the whole thing illegible. – Michael Hardy Jul 9 '14 at 20:02
• Are you really suggesting that the code I pasted above, which appeared in the middle of a sentence written in English, does not amount to obfuscation? It was intended to produce this result: $\varphi(u)=\langle u,v\rangle$. ${}\qquad{}$ – Michael Hardy Jul 9 '14 at 20:06
• You should see the plainTeX source to my dissertation, or better yet the source to missus physics (undergrad) thesis. She asked for the strangest things. Mind you, I think you have a point - that is IMVHO BAD TeX. But what's the problem? – Jyrki Lahtonen Jul 9 '14 at 20:09
• I have sympathy for your cause, but I also have sympathy for that OP. It is IMHO VERY ANNOYING to have to write \Bbb{Z} a dozen times per post, when declaring \def\Z{\Bbb{Z}} once and then using \Z' ever after would do. This is how I still write my lecture notes, slides et cetera. Except that I need to use the LaTex-way with \newcommand... – Jyrki Lahtonen Jul 9 '14 at 20:17
• "they're interspersed with the sentence written out in English" If you wrote them on a blank line cleanly separated from the English instead, it would produce a paragraph with no visible text, creating an unsightly gap in the output. I think you are too quick to assume malice. – user856 Jul 9 '14 at 20:43
• @Jyrki: I think that in this specific case, the preamble is much more complicated than writing the code by hand each time it should appear. – Asaf Karagila Jul 9 '14 at 20:52
• Excuse me, but writing code like this is lunacy. I can't believe someone is defending it. – Michael Hardy Jul 9 '14 at 20:55
• I'm not really sure what the purpose of this question is. The code renders fine, and the question is quite readable; although this might be a case of poor coding practice, it certainly sounds like the poster is not alone in defining such macros. If it works well and renders quickly, why should one consider it to be "sarcasm," or have any opinion of it at all? – user61527 Jul 9 '14 at 22:07
• @T.Bongers Let's generalize here--don't worry about the specific case, but instead consider if this practice became widespread. What happens if I need to edit an obfuscated question? (e.g. a } is left out, and none of the code compiles) TeX code should be written clearly because editors review the code, not just the output. – apnorton Jul 9 '14 at 23:24
• And simply editing out the obfuscating macros without raising a meta-thread wasn't an option because...? – user642796 Jul 10 '14 at 4:30
• Why need we assume malice over ignorance? Let us not forget that LaTeX is a relatively steep learning curve, especially when we start saying that you should use $\langle\cdot\rangle$ rather than $<\cdot>$. Copying in your favorite preamble and going from there is a tempting option to the novice. – user1729 Jul 10 '14 at 8:22
• @ArthurFischer I can imagine users being offended that their carefully crafted code is being completely changed by other users. I think that a general question about the appropriateness of carrying out pure (but quite large) code edits is worth discussing. – user61527 Jul 10 '14 at 8:31
• @T.Bongers Author's source code is still there in the revisions, as it was. The visible appearance of the post hasn't changed... Offended? I can imagine users being offended by pretty much anything. I can also imagine harmful effects of not doing what is right for the fear of offending someone... As someone who frequently copies portions of code from question to answer, I find that having readable question sources to work with is quite useful. Also, the content of the posts is meant to be reusable elsewhere, that's a part of the SE model. – user147263 Jul 10 '14 at 14:53
• @T.Bongers: Perhaps a user's misspelling of words is is a conscious and intentional choice. Or the inappropriate tagging of their questions. Or the lack of MathJax. Or a myriad of other things that many of us don't think twice about "correcting". IMHO, an important feature of the SE model is that users can edit others' posts. That a user might be "offended" by an edit that helps in the future maintenance (or readability, etc.) of a post without changing its content in any meaningful way is really among the least of my concerns. – user642796 Jul 10 '14 at 18:14

For most posts, a single run of this script will suffice. But the post in question has triple-nested macros, which makes it necessary to run the script three times. For convenience, I moved the command with \def to the beginning of document (no preambles are needed, since the script does not actually parse TeX).
1. After the first run, first-level macros throughout the text expanded, for example $$\h$$ became $$0 = \c - \d = \l u , \f \r$$.
2. I copy-pasted the output back into the input box, leaving the \def part as it were originally. Second run changed the above line to $$0 = \l u, \v \r - \l u, \w \r = \langle u , \v-\w \rangle$$
3. Rinse and repeat: $$0 = \langle u, v_1 \rangle - \langle u, v_2 \rangle = \langle u , v_1-v_2 \rangle$$