Hacker News new | ask | show | jobs
by boudewijnrempt 2057 days ago
The reason reveal codes isn't available in Word isn't some kind of petty spite. Word just doesn't intersperse formatting codes in the stream like WordPerfect did (or html does, to some extent). It puts all formatting information in a binary block at the end of each paragraph. That's both more flexible, and more fragile.

As an aside, me and my wife, we translated WordPerfect 6 for DOS into Latin for the Vatican, as freelance translators.

3 comments

> As an aside, me and my wife, we translated WordPerfect 6 for DOS into Latin for the Vatican, as freelance translators.

Come on, now. You can't just throw this out on a tech nerd forum and not explain. What exactly do you mean "translate"? As in, you translated all the menus and help text into Latin, or you helped them integrate good tools for writing in Latin? More details, please. :)

We took the text, and translated it into Latin, so there was a Latin version of WordPerfect for use in the Vatican. Only the user interface, not the dictionaries or things like that. After all, a cardinal is supposed not to need dictionaries to write proper Latin.
I'm a little bit confused by this. Isn't the modern docx format just a bunch of XML markup in a zip file?

Actually, I'm sure the modern docx format is just a bunch of XML markup. I just created a toy docx with the text "This is a test." and ripped it open with a little bit of python that I had lying around from previous experiments along those lines[1]

Looking at the output of the file 'word/document.xml', in relevant part, we see:

  <w:body>
      <w:p w14:paraId="64E164D6" w14:textId="77777777" w:rsidR="00EB525B" w:rsidRPr="00E02EE2" w:rsidRDefault="00E02EE2">
        <w:r>
          <w:t xml:space="preserve">This </w:t>
        </w:r>
        <w:r>
          <w:rPr>
            <w:i/>
            <w:iCs/>
          </w:rPr>
          <w:t>is</w:t>
        </w:r>
        <w:r>
          <w:t xml:space="preserve"> a test.</w:t>
which looks like the underlying XML representation indeed intersperses formatting codes in the stream, at least in part---certainly it's clear that the "is" is italicized"...

That seems like enough information to build reveal codes out of...

[1] https://github.com/paultopia/dedocx/blob/master/deconstruct....

This is the important factor. The Word format’s stream isn’t declarative, like WordPerfect’s is; instead it is imperative.

In other words: WordPerfect is like HTML, Word is like CSS.

WordPerfect definitely has styles, so in a way WordPerfect is like CSS. Whatever Word is it has always been a little broken, and remains a little broken to this day. When a document gets large weird style behavior creeps in and makes the editing slightly non-deterministic. With the lack of "reveal codes" like Wordperfect always had, the result is kind of miserable. If I were King for a day...
To continue the analogies, think of silverware and related instruments.

Notepad and TextEdit are like plastic utensils. They do the job (albeit not very well) and you can't really mess up.

Word, Pages and WordPerfect are like regular forks and knives. Not too much harder to use although they do require a bit more discipline.

TeX (and its derivatives/predecessors - Troff, Eqn, Grap) are like scalpels. Extremely powerful, but if you mess up, it can be hard to recover.

This doesn't even get into the fact that the last category must be compiled into a document, and making sure that everything gets into the funnel can be a real challenge for the uninitiated.