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

What to do when documentation have change the way you use to get things done?

So I was working with node.js but it seems the example(coderacer) is out of date. Here is the link with the real issue of the code.

https://teamtreehouse.com/forum/coderacer-node-is-not-rendering

So doesn't work anymore but, how can I keep getting things done as I am just getting started with node + coffeescript + eco + other dependencies?

6 Answers

Yes, it is tricky. Documentation and tutorials can quickly go out-of-date, especially with NodeJS and Express who have major releases more often. Most software will publish change logs and possibly migration guides to help users adapt to new methodologies.

What I do is get familiar with what has changed that way I can spot what I need to modify mentally when progressing through tutorials.

Ok. I'm trying to be updated according to the method I am having doubts on the link to the other question in the link. Thanks.

You can't. I think any tutorials on something as bleeding edge as node are actually counterproductive, because they are overly specific.

Well my problem was while typing res.render("index.exo") instead of res.send("Hello world")

I've being asking in other forums but they gave me answers that will display the index.eco file but it won't be using the render method that also is important for me because the project I am working on, needs to be done with that or similar. But as I am new to node.js it's quite hard to chose another way like the example they gave me in the forum.

I've just recieved this answer:

express = require("express")
app = express()
cons = require("consolidate")

 app.engine "eco", cons.eco
     app.get "/", (req, res) ->
     res.render __dirname + "/template.eco", layout: false

They told me that eco is now supported by requiring "consolidate". Is this the new way to get this done?

Rodrigo,

You are attempting to use some more advanced/problematic rendering engines in Express. My suggestion would be gain familiarity with how Express works without muddying the water with the more advanced stuff. Try the default express installation that Express generates from the executable. (http://expressjs.com/guide.html#executable) It defaults to Jade templates. Next maybe try out the Hogan engine (Twitter's Mustache engine). Try these variations in different directories so you can compare and see what has changed between them.

Once you have gained familiarity it should be easier to start layering things like coffeescript and some other rendering engines provided by Consolidate.

I don't have any familiarity with the eco engine but it looks pretty old and hasn't been updated recently. That's not necessarily a bad thing if it works well but it has quite a list of issues. So you might want to reconsider the choice of engine.

I wish you well with your effort!

Thanks Chris. I'll keep going as you told me to.

Hey Rodrigo Muñoz did you complete the Code Racer Project. I am so disappointed that the source code is not available and Everything changed so much.

I didn't finished. Istarted learning Python do developing webapps, but there is another course for building a website using node.js