I have been using LaTeX professionally almost every day for almost 10 years, so I think I can say that, by now, I more or less know what I'm doing. I also do a lot of ordinary computer programming, in traditional languages like C++ and Visual Basic. As I compare LaTeX to these other languages, the following question often comes into my mind:
Why is LaTeX so complicated?
Despite my considerable experience with LaTeX, I still regularly encounter non-obvious behaviour and strange error messages, and there are many parts of the language that seem arcane and obtuse. Here are just a few examples:
- Macro hell: tangled webs of junk (
\expandafter, …) sprinkled throughout all but the simplest macros
- The ridiculous
\makeatotherall over the place
- Nonlocal error messages which can be difficult to fix
- No straightforward types (int, bool, float) with the ordinary manipulation functions. Instead, a patchwork of different types of counters and registers, each of which have to be manipulated in their own special way (sometimes
\multiply \pgf@x by 2, sometimes
- Loops and conditionals are much more fiddly than they should be
- No arrays
- Checking for equality is ridiculously awkward (
- No straightforward subroutine syntax
- Fixed memory limits rather than dynamically-allocated registers
- No incremental compilation in most LaTeX engines – if I change the last line of my document, or make a tiny change to a TikZ figure, I shouldn't have to spend tens of seconds recompiling to see the effect
I could go on.
Let me be very clear about one thing: I have the greatest respect for those who developed TeX and its associated programs and packages. The system is enormously impressive and awesomely powerful. Also, every apparently-arcane feature I mention above of course exists for some good reason, and (at least) at the time it was designed, solved a real problem in (at least locally) a sensible way. And other programming languages of course have their flaws.
But surely, it is nonetheless appropriate to recognize the complexity and limitations of the system as a whole which exists now, and ask: does it have to be like this? If we could design a typesetting system completely from scratch, in 2015, couldn't we make something much simpler and more intuitive?