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
lfkwtz
12,295 PointsWhat's the advantage in building this site with Node.js over JS/Jquery?
Since we're only querying for one username at a time, what would be the advantage of using Node.js?
(this question pertains to the "Build a Simple Dynamic Site with Node.js" lesson, in case this question didn't post where I intended it to)
1 Answer
jason chan
31,009 PointsYou can make a real time chatroom. Plus it can have mulitple workers working vs php which is single thread.
Basically real time. Node is basically a written server by yourself.
streams video and audio live. Jquery is more front end making GUI buttons and animations. Javascript well it's all javascript.
lfkwtz
12,295 Pointslfkwtz
12,295 Pointsright but why is it advantageous to that specific lesson/project?
Seth Shober
30,240 PointsSeth Shober
30,240 PointsIt may not be. It might just be the tool they chose to teach because it is prevalently used and good to learn. Also, you can't use jQuery on the backend, and jQuery is just a JavaScript library. Node is a JS runtime that excels at I/O because it is non-block, as well as being fast and efficient. It is actually single threaded, and runs in its own process. You can do things like forking, clustering, and running child processes to increase performance. I'm not sure comparing it to PHP is quite fair.