Saturday, 21 June 2008

LaTeX thoughts and lack of time

I haven't written here for quite a long time — it's because of current semester's ending. I had a lot of work to do with my projects (btw: it's one of them; another video). For every project one has to write a documentation. And I know only one way to write documents that doesn't suck hard. It's the way of TeX. I have written quite a lot of LaTeX documents last month. Here is what I learned:
  • \newcommand and \newenvironment are your friends
  • Making your comands and env names uppercase lets you avoid clashes with predefined ones.
  • Try to be semantic from very beginning if it's easy. For example: you mention electronical parts or Java classes all over your document. Add \newcommand{\Class}[1]{#1} in the beginning of your document and wrap all class names with \Class{}. It would be easy do make all class names typed with some special font later on.
  • If your documents take a lot of time to compile
    • break it intro few files and \input them. Comment out inputs you don't work on currently.
    • use draft option
  • Thinking about writing documents in TeX as of programming helps a lot!
    • Being a nazi with DRY principle makes your document sources look very semantic and the output is prettier. You do more tweaking if you can do it in one place instead of 20 places.
    • Do the simple thing that gives you desired result. If you repeat yourself ⇒ abstract out repetition intro new command(s) and/or environment(s).
    • Refactor!

There are some things I wanted to write about, but I haven't got time. Here is my public TODO list:
  • Why Eiffel standard library is so cheesy that it makes me want to write program in brainf*ck instead of Eiffel (which is quite a nice language), and what can we learn from that (in "I promise, I'll never code something similar" way of learning)
  • Why hovercrafts rock and how it is like to discharge 8 Duracell bateries in 20 minutes of playing with your homemade, bluetooth controlled one. (It's much more Witek's one than mine, but still)...
  • Hooray, yet another post about monads!
  • Hooray, yet another post about Scala!
  • Erlang, OOP and functional programming
  • I switched to zsh

Maybe one day one of those will turn intro full-blown post. Maybe.