u2622.ca

☢ Thoughts on software development, with an odd jaunt into language learning

Disadvantages of Using Meteor (Over Rails)

| Comments

You can save significant amounts of time by developing some web applications by using Meteor instead of Ruby on Rails, but it doesn’t come without drawbacks. Here are some of the ones that I’ve encountered: What are the disadvantages of using Meteor compared to Ruby on Rails?

Immature Environment: The biggest problem right now is that Meteor is new. Pretty much brand new, in the scope of web development. It’s not even version 1.0 yet, though it’s getting close. This means that it doesn’t have as many users, as many tutorials, as many books, as many screencasts. It can be hard if you run into a problem that no one else has run into yet, so you’ll need to be willing to dig into it a bit yourself. I’ve been there, and fortunately Meteor’s codebase is fairly cleanly written (especially compared to Rails and AngularJS, two other frameworks whose code I’ve read).

Not Widely Supported: Another consequence of being so new is that there aren’t as many hosting services available for Meteor apps yet. It is possible to deploy Meteor on Heroku, and in my experience it works well, though it feels very raw.

Nothing but JavaScript: You must run JavaScript (or Coffeescript) on the server side. This isn’t a big deal for me, but JS is definitely far from the first language I would choose to work with. The upside is that you can run the same code on the server and the browser, without worrying about having to cross-compile from another language.

Only MongoDB: As of now, the only supported database is MongoDB. They have plans to expand this in the future.

Rapidly Changing: The Meteor API is rapidly changing, so each new minor version may bring breaking changes. This is expected to lessen as it reaches 1.0.

Testing Frameworks: Testing frameworks haven’t been a high priority since the beginning, and the ones available so far have tended to be cumbersome and brittle. The community is working on solutions, but nothing stable has yet emerged, and the testing culture is nothing like the Ruby on Rails community’s.

While there are many disadvantages, I feel like the advantages heavily outweigh them (usually). But the list of advantages is for another post entirely!

What are some other disadvantages you can think of? Email me or leave a comment!

Implementing Web Hooks With Meteor

| Comments

It’s possible to add web hooks to your Meteor application by using iron-router.

Declare a server-side route in your Routes.map declaration:

    Router.map(function() {
      ... // Your other routes go here

      this.route('hook', {
        path: '/hook',
        where: 'server',
        action: function() {

          // Watch the Meteor log to see this output
          console.log("Hook called.");
          console.log("Headers: ", this.request.headers);
          console.log("Data: ", this.request.body);

          this.response.writeHead(200, {'Content-Type': 'text/html'});
          this.response.write("You wrote: " + this.request.body.message);
          this.response.write("\n");

          // `this.response.end` *must* be called, or else the connection is left open.
          this.response.end('Success!\n');
        }
      });

    });

To test it out, issue this curl command from the command line:

    curl -H "Content-Type: application/json" -d '{"message":"foo"}' http://localhost:3000/hook

The documentation for this.response and this.request are available on the node.js website: http://nodejs.org/api/http.html

I’ve created a sample Meteor application demonstrating this, which you can view at https://github.com/rgould/meteor-posthooks

Not clear enough? Send me an email at rgould@u2622.ca for some more help!

Icelandic Language Music Roundup

| Comments

While focusing heavily on learning Icelandic, I dug deeply looking for Icelandic-language music. There are surprisingly high amounts of Icelandic bands that sing exclusively in English. Here are my favourite songs with Icelandic lyrics:

Mammút - They play energetic rock music, bordering on post-punk sometimes. The first Icelandic language band I liked, and my favourite still. Here’s Svefnsýkt: <iframe width="420" height="315" src="http://www.youtube.com/embed/aeGZriDklEo" frameborder="0" allowfullscreen></iframe> Bónus: Rauðilækur

Q4U - Postpunk from the 80s, mostly in Icelandic. They’re still around. Here’s Sigurinn: <iframe width="420" height="315" src="http://www.youtube.com/embed/iiWcZKhWlQA" frameborder="0" allowfullscreen></iframe> Bónus: Snjóhvít

Samaris - Atmospheric minimal electro/triphop with clarinet. Very haunting. Here’s Góða Tungl: <iframe width="560" height="315" src="http://www.youtube.com/embed/_pKuzdMFE8k" frameborder="0" allowfullscreen></iframe> Bónus: Stofnar Falla

Nóra: Indie rock, ranging from upbeat and energetic to atmospheric and introspective. The more I listen, the more I like it. They sing entirely in Icelandic. Here’s Himinbrim: <iframe width="420" height="315" src="http://www.youtube.com/embed/w66kIAWBFs8" frameborder="0" allowfullscreen></iframe> Bónus: Sjónskekkja

Lockerbie - Post-rock, but with a bit more pop/rock than usually characterised by Icelandic post-rock. Here’s Snjóljón: <iframe width="420" height="315" src="http://www.youtube.com/embed/cUWzNsPHcEQ" frameborder="0" allowfullscreen></iframe>

Úlfur Úlfur - Hiphop with awesome backing percussion. They sing entirely in Icelandic. Here’s Út: <iframe width="560" height="315" src="http://www.youtube.com/embed/jCgbt73gD74" frameborder="0" allowfullscreen></iframe> Bónus: Ég er farinn

Pascal Pinon - D.I.Y., lo-fi, indie pop electronic. Many songs in Icelandic. Here’s Ekki Vanmeta: <iframe width="100%" height="166" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player/?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F71960187"></iframe> Bónus: Sandur

Sólstafir - Post-black metal, with elements of country and rock. They are amazing live. Their album Svartir Sandar is entirely in Icelandic and highly recommended. Here’s Fjara: <iframe width="420" height="315" src="http://www.youtube.com/embed/A6j7mUxGz20" frameborder="0" allowfullscreen></iframe> Bónus: Svartir Sandar

There’s lots of music that I’ve discovered that I didn’t cover here, but I only wanted to showcase the music I liked the most. Feel free to leave other suggestions in the comments.