Keep ’em coming: Why your first ideas aren’t always the best
Coming up with actually good, creative things is deceptively simple yet surprisingly difficult; in fact it&#x27;s quite a slog.<p>I&#x27;ve been working on a new data format [1] that I&#x27;d expected would take me two years to create. 5 years later, I&#x27;m finally seeing the light at the end of the tunnel. The format that exists now is almost unrecognizable compared to the initial version, or even what I had after the first year of development (digging through the git repo would prove interesting).<p>Other than devouring every data format spec I could get my hands on, one big help was to _leave_ it for weeks, even a month, and then come back to it. This allowed me to view something with a fresh perspective that I simply couldn&#x27;t see if I were working on it every day.<p>Case in point: Unicode escapes.<p>I wasn&#x27;t happy with the current state of affairs for unicode escapes (\uDDDD or \UDDDDDDDD) which are clunky. I wanted something better, without the zero stuffing.<p>My first incarnation was as follows:<p><pre><code>    * backslash
    * a digit from 0-9 specifying how many hex digits follow
    * that many hex digits
</code></pre>
So for example \0 is NUL, \19 is TAB, \51f415 is dog, etc.<p>Sure, it works, but that length prefix really makes it hard to read.<p>A year after that, I came up with the following:<p><pre><code>    * Initiated with \+
    * The hex digits to represent the codepoint
    * .
</code></pre>
So for example \+0. is NUL, \+9. is TAB, \+1f415. is dog, etc.<p>That was much less confusing, since the numbers are properly isolated from the escape characters.<p>It wasn&#x27;t until months later that I finally spotted the obvious after a break:<p><pre><code>    * Initiated with \{
    * The hex digits to represent the codepoint
    * }
</code></pre>
So for example \{0} is NUL, \{9} is TAB, \{1f415} is dog, etc.<p>And there have been so many of these moments that never would have happened if I&#x27;d pushed the format through after only 2 years.<p>[1] <a href="https:&#x2F;&#x2F;concise-encoding.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;concise-encoding.org&#x2F;</a>