Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript

Node v4.0.0 was just released. Can someone experienced explain what's the difference between using 4.0.0 and 0.12.7?

So Node v4.0.0 was released today.

Since I've been using v0.12.7 to learn (the version that was on their homepage), can someone explain what the key difference are once I switch?

What gotchas should I be looking out for?

2 Answers

Here's a link that should clear it up for you somewhat.

Thanks for the link.

You've sort of got a loaded question here. I actually work with somebody on the node core team, so let me try to give you my brief and hopefully somewhat humble take on the situation.

First let's look at why io.js? Awhile back some people got antsy about node not pushing a version 1, so they created a fork and called it io.js. The idea was to have more frequent releases, while hoping to encourage node to do the same. Unfortunately, it got carried away for awhile and there was a bit of a feud. Luckily people came to their senses and decided it would be best to merge back together and continue forward as one.

Why version 4 instead of 1 you ask? io.js had reached version 3 and to avoid confusion we now have version 4 of node, which is just the merging io 3.x and node 0.12.x. Joyent, who owns node has formed a technical committee to steer the future of the platform. The biggest thing to come of this is probably the release cycles, which will be more frequent and on a schedule to cut new releases every 6 months and having long term support and maintenance cycles as well, lasting 30 months for LTS and maintenance combined. This is extremely beneficial to larger companies who are beginning to accept node into their production environments.

Technically speaking the biggest change is the use of V8 v4.5. Basically, V8 is the guts of what runs JS in node and the Chrome browser. Most notably, this newer version allows the use of many ES6 features by default, which prior may have required a feature flag.

Here is the node 4.0.0 release announcement, that I found very enlightening. It is generally best practice to wait a week or two for initial patches before pushing anything to production. At this point we are all sort of figuring it out together.

I encourage you to continue following and playing around with the new releases and features, but beware that most companies are supporting 0.10.x and up, so it is important to know previous versions as well, which are more prevalent in production applications than the newest cutting edge releases.

Also, if you are looking for a 'real world' gotcha, here is something I was looking into today.

https://github.com/nodejs/node/issues/2754

https://bocoup.com/weblog/whats-in-a-function-name/

Eventually you'll realize you're down the rabbit hole, and it was actually a bug in V8. Gahh!!