0
$\begingroup$

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 $$

$\endgroup$
  • 1
    $\begingroup$ 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. $\endgroup$ – Jyrki Lahtonen Jul 9 '14 at 20:01
  • 1
    $\begingroup$ 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. $\endgroup$ – Michael Hardy Jul 9 '14 at 20:02
  • 1
    $\begingroup$ 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{}$ $\endgroup$ – Michael Hardy Jul 9 '14 at 20:06
  • 2
    $\begingroup$ 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? $\endgroup$ – Jyrki Lahtonen Jul 9 '14 at 20:09
  • 3
    $\begingroup$ 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... $\endgroup$ – Jyrki Lahtonen Jul 9 '14 at 20:17
  • 2
    $\begingroup$ "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. $\endgroup$ – Rahul Jul 9 '14 at 20:43
  • 2
    $\begingroup$ @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. $\endgroup$ – Asaf Karagila Jul 9 '14 at 20:52
  • 4
    $\begingroup$ Excuse me, but writing code like this is lunacy. I can't believe someone is defending it. $\endgroup$ – Michael Hardy Jul 9 '14 at 20:55
  • 5
    $\begingroup$ 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? $\endgroup$ – user61527 Jul 9 '14 at 22:07
  • 2
    $\begingroup$ @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. $\endgroup$ – apnorton Jul 9 '14 at 23:24
  • 6
    $\begingroup$ And simply editing out the obfuscating macros without raising a meta-thread wasn't an option because...? $\endgroup$ – user642796 Jul 10 '14 at 4:30
  • 3
    $\begingroup$ 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. $\endgroup$ – user1729 Jul 10 '14 at 8:22
  • 2
    $\begingroup$ @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. $\endgroup$ – user61527 Jul 10 '14 at 8:31
  • 2
    $\begingroup$ @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. $\endgroup$ – user147263 Jul 10 '14 at 14:53
  • 3
    $\begingroup$ @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. $\endgroup$ – user642796 Jul 10 '14 at 18:14
6
$\begingroup$

Although the post has been already brought into shape, for the future occasions I will point to online macro-expander written by Z.H. from TeX.SE.

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$$
  4. Voilà, macros are gone.
$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .