Analysis paralysis and the Node.js ecosystem
Saturday, December 20, 2014 — New: 8" at 6200', 10" at 8000' — Totals: 28"/101"— Squaw Snow Updates (@SquawSnow) December 20, 2014
This was done by a PHP script that scraped Squaw's snowfall tracker every hour to check for changes. But last month I was looking to build something “real” in Node and decided that rewriting this script would be a good place to start.
Analysis paralysis is the state of over-analyzing (or over-thinking) a situation so that a decision or action is never taken, in effect paralyzing the outcome. (Wikipedia)
It's natural to want to do things "the right way", and I just kept thinking; Is this package already outdated? Is this random person on GitHub actually maintaining this package? Will X play nicely with Y? What would someone experienced use here? Didn't I just read something about a fork of Node that was going to progress even faster?
Perhaps this is just typical of all newer languages/frameworks and I had false expectations about Node feeling more mature given its popularity. Turns out that the Node ecosystem poses a challenge for some experts as well:
So maybe that's just the way it's gonna be. Time to make some choices and start coding.
After a reading a few tutorials and opinions I decided a few things:
- I'd use Node 0.11x invoked with the
--harmonyflag for ES6 for generator support (details). After using Twisted's deferred.inlineCallbacks for years I can't imagine returning to callback hell. And flow control libraries like async still feel dirty to me. Language-level support is where it's at.
- Koa looked like a nice basic web framework to start with.
- Heroku would make a nice host since they support Node well.
And here's the code: https://github.com/powdahound/squawsnow
It really doesn't do all that much, so didn't take too long to put together. The hardest part was probably figuring out which external packages were going to play nicely with ES6 generators/Promises for Koa. There are surely things I've done wrong but it's in the wild and I learned a lot along the way. If this project were of more importance, this might even be one to throw away.
Now I wonder how things will change before my next Node project...