﻿<feed xmlns="http://www.w3.org/2005/Atom">
  <title type="text" xml:lang="en">CodeMirror</title>
  <link type="application/atom+xml" href="https://d.moonfire.us/tags/codemirror/atom.xml" rel="self" />
  <link type="text/html" href="https://d.moonfire.us/tags/codemirror/" rel="alternate" />
  <updated>2026-07-16T17:32:05Z</updated>
  <id>https://d.moonfire.us/tags/codemirror/</id>
  <author>
    <name>D. Moonfire</name>
  </author>
  <rights>Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International</rights>
  <entry>
    <title>Apparently adults don't make mistakes</title>
    <link rel="alternate" href="https://d.moonfire.us/blog/2014/01/06/apparently-adults-dont-make-mistakes/" />
    <updated>2014-01-06T06:00:00Z</updated>
    <id>https://d.moonfire.us/blog/2014/01/06/apparently-adults-dont-make-mistakes/</id>
    <category term="programming" scheme="https://d.moonfire.us/categories/" label="Programming" />
    <category term="writing" scheme="https://d.moonfire.us/categories/" label="Writing" />
    <category term="author-intrusion" scheme="https://d.moonfire.us/tags/" label="Author Intrusion" />
    <category term="codemirror" scheme="https://d.moonfire.us/tags/" label="CodeMirror" />
    <category term="typescript" scheme="https://d.moonfire.us/tags/" label="TypeScript" />
    <content type="html">&lt;p&gt;When I was visiting my dad, my cousin surprised us by showing up with his three girls. The eldest, six years old, and I started playing with blocks. I ended up trying to reconstruct the particle accelerator my dad worked on for a number of years before she convinced me to make a hospital instead. Somewhere around the efforts to duplicate I-94, I-90, I-355, and I-55 using wooden blocks, I made a mistake at the I-90/I-94 junction. I pointed it out (proudly as I'm wont to do).&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;"Adults don't make mistakes, my teacher said so."&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I was immediately non-plussed with her teacher. Mistakes are a part of life, and with my style of life, I consider a mistake to be a far better learning experience than always succeeding. I pointed out that everyone makes mistakes, we just make different ones, but I don't think she was convinced that somehow an adult was less than perfect.&lt;/p&gt;
&lt;p&gt;&lt;!--more--&gt;&lt;/p&gt;
&lt;h1&gt;The learning process&lt;/h1&gt;
&lt;p&gt;I spent the last week or so working on &lt;a href="https://github.com/dmoonfire/author-intrusion-ts"&gt;Author Intrusion&lt;/a&gt;. I didn't want to and I was getting seriously frustrated (and despaired) about the entire thing, but I knew that if I kept plugging at it, I'd eventually get over the problem and into the fun stuff again.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;"Just keep swimming." --- Dori, &lt;em&gt;Finding Nemo&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;As usual, my self-inflicted complications makes it harder to succeed. I want this to be cross-platform, so I have to pick libraries, tools, and methodologies that aren't as well traveled as if it I stuck with a purely Windows application. I also want it to work without a network connection because my cabin visits don't have Internet (and I hate programs that are "always connected.")&lt;/p&gt;
&lt;p&gt;However, I got stuck with some of the decisions I made. So, I spent the last week relaxing some of the requirements (no Internet for now) and trying a different approach. The previous version (now) used &lt;a href="https://github.com/rogerwang/node-webkit"&gt;node-webkit&lt;/a&gt; to gather everything up in a single package. It mostly worked, but I was doing a bit too much and hit a wall when I couldn't figure out how to get a reliable unit test working on the editor.&lt;/p&gt;
&lt;p&gt;So, I backed away from it and tried a different approach. The last few months of TypeScript and Javascript changed how I used the language and my comfort level. I also took another look at the other Javascript editor libraries, to see if I could avoid reinventing the wheel. After looking at it, I decided to remove some of the things I wanted to add (&lt;a href="http://www.w3.org/TR/html-markup/ruby.html"&gt;Ruby markup&lt;/a&gt;) and use &lt;a href="http://codemirror.net/"&gt;CodeMirror&lt;/a&gt; instead. It doesn't exactly work, but there is a lot more than me reinventing the wheel, so I'm going forward with that.&lt;/p&gt;
&lt;p&gt;If it doesn't work, it's just another way that doesn't work and I'll learn from my mistakes.&lt;/p&gt;
&lt;h1&gt;Where I got in a weekend&lt;/h1&gt;
&lt;p&gt;Given the fact I tore almost everything down and started again, I'm pretty happy with where I am. I got the basic integration between CodeMirror and my code working. The persistence layer is abstracted out with one that uses HTML5 File API (which is hard to access) and a hook for using the Dropbox API (which I will implement after I get more done with the filesystem). Later, I'll get a node-webkit-specific version for the single-package implementation. It also leads into the long-term goal of having something hosted (and potentially income-producing) with just adding another persistence plugin.&lt;/p&gt;
&lt;p&gt;It also means I don't have to figure out the install story for the release (something that bugged me) since I can just host it on a website. None of the code needs a server API since even the Dropbox API (which I learned from hacking &lt;a href="https://github.com/MartinSGill/TodoTxtJs"&gt;TodoTxtJs&lt;/a&gt;) doesn't use a server API.&lt;/p&gt;
&lt;p&gt;It isn't all roses, of course, but I'm hoping that my increased understanding of the Javascript ecosystem has finally revealed a path that could work since I still think the Gtk# version is a dead-end.&lt;/p&gt;
&lt;h1&gt;In the coming week&lt;/h1&gt;
&lt;p&gt;I'm switching over to writing for the next week (because I like these weekly sprints). I have a couple things I really want to get done:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;I'm submitting a chapter of &lt;a href="http://d.moonfire.us/blog/tag/sand-and-love"&gt;Sand and Love&lt;/a&gt; on Sunday to the writing group.&lt;/li&gt;
&lt;li&gt;I also have a rejected submission that needs changes before sending it back out (per the editor's request)&lt;/li&gt;
&lt;li&gt;I have a story that I need to get out of my head&lt;/li&gt;
&lt;li&gt;There was two calls for submissions that specifically asked me that I want to enter&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I'm also enjoying the fact that I have no major plans in the next few weeks (except for a board game night on Saturday).&lt;/p&gt;
</content>
  </entry>
</feed>
