Bill Farrar

Portfolio Site and Blog

The New Project

June 10, 2013

One of the things I’ve really enjoyed about my current assignment is that I’ve learned a lot about  new web technologies. One of the secrets to longevity in technology is to keep your skills and knowledge up to date.  The trick is often picking which technologies to watch and which ones to ignore.  Several years ago, I had the choice between learning Flash or HTML5/Canvas and JavaScript.  My thought was that while Flash was pretty healthy (at the time), it’s days were numbered.  This wasn’t a hard guess - Canvas was widely supported, and it didn’t look like Flash was ever going to be properly supported on iOS.

The advantage for working for a company doing web and interactive tech is that I can see what tools are being used, what technology other developers are excited about and find out about things I’d not seen uses for in the past. Then what I need, of course, is a project to work on. Sometimes work provides those, but it’s usually a good idea to build something yourself before you commit to your work that a thing can be done.  Plus you then have a good idea of what the sweet spot for the tech is, and how to use it — or know to stay away from it.  My hard dives are littered with half-started projects that I abandoned after seeing how the library functioned in a real project — or didn’t.

A few weeks ago, I was considering a text editor, or rather, a word processor.  I use Google Docs for a lot of my personal text editing, but there’s a feature that I want that it doesn’t have — and it’s not open enough for me to write a plugin for it. The idea was that I wanted an index alongside my document, but not part of it.  I’m not looking for headers, but rather an outline. I want the outline to be there when I’m editing, but not be there in the document, cluttering things up.  The document sections can be any size, so it needs to visual expand as I type, but keep the outline it’s attached to right there with it, so I know what section I’m working on. Google Docs doesn’t have a plugin architecture, and I don’t really want to rewrite a word processor just to get this feature, so I shelved and let it sit.

Over the next few weeks I developed some extensive code in node.js for work, as well as a simple video game that also used socket.io. That was fun, and I’m really liking some of the things you can do with the two technologies (I even wired up some php server code to talk to socket.io.) I have, over the past few years become a huge fan of JavaScript and what can be done with it.  I know there are complaints about it, but that’s been true of every major language ever, and following best practices tends to help. [There’s a post in here about  callback hell and how I never really got into it because of the way I code, which I’ll write later.]

One of my co-workers is working on an internal app that’s data-centric, and using angular.js for that.  We talked about it a bit, and I grabbed a copy of it, and messed around with it. It’s kind of interesting, I can see using Yii or Cake’s REST API routing  (and dropping their front end generation)  to build an app with it  At the same time, that feels like overkill for a lot of things.

But what I did realize is that angular.js and some clever JS and HTML could deal with the data issues I would have with the text editor + outline. I could have an app that could save and load files locally perhaps, or use cloud storage. I did a bit of research on databases with node, and most things are supported. However, I’ve been spoiled by the models in Cake and Yii, so I don’t want something where I’m constantly writing SQL statements and messing around at that level.

The key storage for node, though, seems to be MongoDB, via mongoose.  MongoDB is a no-sql database that’s quite different from what I’m used to.  I loved my DB classes in college, relational algebra, set theory, it’s all nice. The first half of my career was really writing SQL code, stored procedures and things like that. But the world is changing, and exactly that kind of experience is starting to age a bit.

So it’s time to move on, and while we’re moving on, let’s use all knew technologies, and basically write everything in one language: JavaScript.

So, that’s the new project: an outline-based word processor written as a web application, using AngularJS for the frontend and  Node/MongoDB as the backend.  There’s a few features that we’ll have to support, but I’ll go into them in the next blog.

Bill Farrar
Bill Farrar
Full stack developer with over 20 years in web technologies and over 30 years as a software engineer and designer. Senior systems analyst and team lead, spending time running projects and mentoring peers.