Main | February 2003 »

January 2003

January 31, 2003

Illogical Markup

Andy and I are about to start a new spurt of article and paper writing, so I’m looking around for some tools to make it easier. We publish to the web a lot, so being able to generate decent looking HTML is a plus. We also want to generate good-looking printed documents from the same source, along with PDFs. So I thought I’d look at DocBook. In the past I’ve always been put off by the hassle involved in generating nice looking output from DocBook, but perhaps this time necessity would overcome my natural laziness. So over to www.docbook.org I go.

Unfortunately, I’m still not convinced. This time is didn’t even get as far as the arcania of formatting objects. Instead, I was floored by an example in the DocBook FAQ. Here’s how the FAQ recommends you mark up the Emacs key sequence C-h C-f (control H, followed by control F, which normally displays help on a function).

   <keycombo action="seq">
      <keycombo action="simul">
        <keycap>C</keycap>
        <keycap>h</keycap>
      </keycombo>
      <keycombo action="simul">
        <keycap>C</keycap>
        <keycap>f</keycap>
      </keycombo>
    </keycombo>

Whoa! Some markup! And at first sight, pretty logical: a keyboard combination consisting of a sequence of two simultaneous key presses, the first a ‘C’ and an ‘h’, the second a ‘C’ and an ‘f’.

Except, this isn’t logical markup at all. It is some remarkably verbose hybrid. It totally fails to convey the most important fact about the keys you press, namely that you are pressing control and h, followed by control and f. Instead, it simply encapsulates the Emacs convention of showing an uppercase ‘C’ to mean control.

And why is this bad? Because I want true logical markup. In LaTeX, I’d define some macros to let me write

  \KeySeq{\Control{h} \Control{f}}

This (to my mind) a lot easier to read and type. But more importantly, it gives me the flexibility I need. Perhaps in online documentation I want to use the ‘C-h’ convention. No problem, I just write the macro appropriately and every control sequence is documented accordingly. If a publication says that their standard for control keys is "^h ^f", then a single change to the macro updates the whole document. And if I want to use fancy pictures of keys, my macros can do that too.

It seems to me that DocBook is falling in to the same trap as the rest of the XML world, confusing tedious verbosity for semantic information.

Of course, I’ve never used it for anything bigger than a FAQ, so I could be wrong.

Slow Scrolling Terminal

Want to annoy an OS X fan? Wait until they leave a Terminal window open, then at a command prompt type

  % cat
  <esc>[1m
  ^D

(where <esc> is the escape character and ^D is control D). This sequence turns on bold fonts (which actually makes no visible difference in Terminal). Except… for some reason, once the fonts are bold, Terminal burns CPU like crazy every time it scrolls. Command prompts can take a second to come back, and ls -l /usr/bin hogs the machine for achingly long seconds.

The bug report is in, but it’s still a strange little glitch.

How To Keep Your Job

Jay Zimmerman (www.completeprogrammer.net) arranged for me to give a talk at the Austin Java User’s Group (www.austinjug.org) as a way of publicizing his upcoming Lone Start Software Symposium. I decided to try giving my "How to Keep You Job" talk for the first time (online at www.pragmaticprogrammer.com/talks/HowToKeepYourJob/HowToKeepYourJob.htm).

I’ve been getting more and more convinced that this topic is significant. The industry is changing underneath us, and most developers seem oblivious, preferring to blame the recession rather than face an awkward fact: we’re never going back to the easy life of the late 90’s. Instead, every developer is increasingly going to have to fight to stay attractive, working hard to develop the skills needed as the industry matures and more and more of our work becomes commoditized.

I’m liking the Knowledge Portfolio metaphor as well: it seems to communicate the idea of taking personal responsibility for your future. The financial portfolio concepts of planning, diversification, regular investing and periodic rebalancing fit nicely into the knowledge metaphor too.

Now in Beta

  • Programming Ruby, 3rd Edition
    Third Edition, Covering Ruby 1.9, now in beta
My Photo

Pragmatic Stuff

Photos

  • www.flickr.com
    This is a Flickr badge showing public photos from pragdave tagged with pragdave_badge. Make your own badge here.

Site Search

  • Google Search

    The web
    PragDave