Right, so, let’s just say that thinking I’d be able to get a bunch of coding done while on paternity leave was overly optimistic.
My brand-new daughter, Eliza Rose:
She’s adorable, but for the first few weeks of her life she wasn’t exactly conducive to getting much of anything done. Now that she’s a little over a month old she’s sleeping for longer, more regular periods, and we’re all sort of getting used to each other and how we operate, so it’s becoming easier to steal an hour here or there to do non-baby things like random development projects. I anticipate making more rapid progress in August, although I fear that beer production will continue to suffer until she can hold her pacifier.
Which is not to say I haven’t already made a bit of progress. Without further ado…
AngularJS: Foundation for Apps provides a pretty solid canned development environment, including Gulp and a local server setup. That’s very handy, with the caveat that, as with any new tool, it took a bit of time to get the hang of configuring Gulp to work the way I wanted. The nice thing about Angular, especially as packaged with Foundation, is that you can wireframe an app in no time flat–as long as you stay within Angular’s lines, of course. Currently, it looks pretty, although the page transitions are doing a funny thing where the incoming div stays off page but creates space in the DOM that pushes the outgoing page down before it moves. I suspect it has to do with how Foundation is handling the transition animation ( relative positioning, I’d guess ) and is probably a situation where I’ve gotten too cute too fast.
I’ve also run into an issue with actually getting the container values into the select menu without an initial blank value. I remember this same issue cropping up while working on Field Guide, and it has to do with the way Angular uses array comprehensions. A quick search of Stack Overflow shows that it’s a pretty common problem and it’s a function of the less-than-clear way comprehensions are written. They’re uglier than sin, frankly, and I hate them, just in case anyone’s asking.
BackboneJS: With some downtime at work I started the Backbone version, and I must admit that, compared to Angular, it’s a joy to work with. It’s much simpler and totally unopinionated, which is a real blessing on such a small project. Yes, you do have to hand-wire the linkage between the view and the model, something Angular handles automatically. In practice, however, I don’t find the data binding in Backbone to be too onerous. In my admittedly limited experience, the time you save by not having to do it in Angular is lost (and then some) to struggling against ( or refactoring for ) the “Angular Way” and having to do the occasional bit of hand-wiring to fix situations where the native binding isn’t working as it should. At this stage, I have a model and a view, but no calculations or functionality.
At this point it might seem like I’m leaning towards Backbone, and, honestly, that’s not entirely wrong. Backbone is a nice, simple library that makes it easy to model data and tends to stay out of your way. Collections will automatically create models with the appropriate properties if given an API URI as a source, which is really cool. Also, Backbone deliberately leaves the View components fairly thin so that you can swap its native functionality out for something like ReactJS, which shows a lot of promise.
But, lacking the opinionated structure of Angular, Backbone can leave you hanging a bit when it comes to structuring your app. This is by design, of course, and not without merit, but I do find myself missing the simple clarity of Angular’s explicit Model-View-ViewModel structure. Backbone lends itself to something like a Model-View-Presenter structure but leaves the implementation up to the developer. It’s not a deal-breaker, certainly, but I’ll admit that I missed Angular’s system of Controllers, Services, and Directives. There’s an aspect of Angular development that is almost like filling in the blanks. Backbone’s more laissez-faire approach isn’t a drawback per se, but, again, Angular automates app structure in a sense where Backbone puts the burden on the developer, which could be an issue on larger applications or in team settings.
In other news…
I’ve set up Linux Mint in a virtual machine on an external drive I had laying around and, so far, am pretty happy with the setup. With 16 GB of RAM I’m able to toss a healthy chunk to the VM without noticing it, and the external drive is about a terabyte running on USB3, so performance is actually pretty crisp and I don’t need to worry about running out of space. I’ll be using it as a development environment in the future, particularly for Meteor, which includes a Linux- and Mac-only utility to automatically convert code to an Android or iOS application, which is yet another reason why MeteorJS is so friggin’ cool.