The Prose Problem III

I’ve talked about what I want, and what hasn’t worked, so now we move on to what I’m trying to make. Given my set of requirements, I decided that a web- based tool would be the path of least resistance. It also has the benefit of being a set of technologies that I’m somewhat familiar with, but also want to gain some more experience in.

I guess I should back up a second. I do have experience with web tech, to a degree, creating web APIs in Python. That said, it wasn’t at a conventional website or web app, and I actively avoided doing frontend work professionally.

So I’ve had a vague inkling for a while that I want to learn JavaScript and the DOM and all that crap, but I want to learn it my way. Given what I wanted to do, a web app seemed to actually fit the problem and domain fairly well.

And that’s what I’m doing, and so far it’s been an interesting experience, and a mostly positive one as well. JavaScript is a pretty odd language, but the ability to limit compatibility concerns to browsers I actually use (modern Firefox and Chrome) makes it fairly painless.

Though I will say that I went into this after having read JavaScript: The Good Parts so I’m at least aware of good practices and some of the gotchas, as well as the general flavor of the language. I also intentionally used the WebComponents polyfill to break up my code and make the main HTML not suck.

Even given my generally good experience with JavaScript so far, I’m still gonna give the language crap if asked about it. It’s honestly not well designed. The design foibles of the language are well documented on the internet, so I won’t harp on them here, but if given the choice to use something else for the same domain (that was supported and didn’t involve a cross-compilation step), I’d take it in a heartbeat. Unfortunately, that’s not really a choice.

The other half of the application is, as I mentioned, written in Go. Go is something that I’ve been watching for a good while, and I’d been looking for a reason to use it. Given what the language designers seem to be going for, it seemed like a good fit for the project.

Probably the biggest reason I decided to use it, though, was performance. As I mentioned earlier, I’ve used Python professionally for a few years, and though I like a lot about the language, performance is not one of those things. Given the machine I want to run this on (a router-sized box) and the load it’s already under (Minecraft), I needed all the performance I could get.

So far, Go has been an interesting experience, especially coming from Python. I could use a lot of words to describe my time with Go (and I probably will at some point, once I’ve used it some more), but the description that comes to mind the most is “boring”, and not in a bad way. It’s pretty obvious that it comes from the Unix and C guys (or two of them, at least), and though it does add some neat things over C, in a lot of ways it feels like the same language with half a step “up” in the high-level-vs-low-level scale.

…I just looked up and saw how many words I spent talking about the languages, and how few I spent talking about the project in question. It’s understandable, I suppose, given that it’s still pretty early on and I’ve got only the very basics working. Right now I have a text editor that organizes groups of files into “projects”, and saves them to git (and woo boy does libgit2 deserve some talking about, but that’s for later). The frontend assumes nothing about the network connection, and saves everything to LocalStorage. Connection to the backend can disappear at any time, including a reboot of one or both computers and nothing will be lost. Yay! It’s far enough along that I’ll probably wind up hosting it on this box within the next few days, as soon as I get the frontend auth handling working. Once I get it to that point, I fully intend to switch all of my prose writing over to it. Dogfooding should help me figure out what order to attack the features beyond that point, as chasing supposition just isn’t worth my time.

You know, looking over everything I’ve written, I should probably write up more coherent thoughts on JavaScript and Go. It’s a shame I haven’t recorded what I’ve thought along the way, as that might have been interesting to review. Oh well. I think I have ideas for topics for the next few days though.

Oh, and I’ll no doubt have more to say about this particular project as I go. Hopefully it’ll even be something interesting next time!