On Dec 16, 2013, at 7:51 PM, Orthoducks <orthodu...@gmail.com> wrote:
> <snip happens>
> I'm working my way through Chapter 1 of Node Cookbook, by David Mark 
> Clements, one of the books that was highly rated on the site where I go for 
> recommendations. I'm starting to wonder "Why are we here?" The chapter is 
> titled "Making a Web Server," and it contains exactly what the title promises.
> 
> If I were teaching a web development language, I'd want to start by treating 
> the web server as a black box and teaching how to write an elementary web 
> application. Working with the web server would be an advanced topic. Readers 
> would be better equipped to understand it after they had some experience with 
> the language, and many would not want to bother with it at all until they 
> needed it to solve a real problem.
> 

Dear Orthoducks,

the thing is, NodeJS is not a web development language. JavaScript is. Or used 
to be. Now, with NodeJS, it can be used as a general purpose development 
language. What then is NodeJS? It’s "a platform built on Chrome's JavaScript 
runtime for easily building fast, scalable network applications”.  In 
particular, NodeJS is not a web server.

Coming from the PHP world, you are used to or familiar with Apache or Nginx 
acting as a web server that executes scripts written in PHP using the PHP 
interpreter (though, as you know, PHP has a built-in web server that you can 
use for testing, etc). The practise in the NodeJS world is a bit different 
(though, I would guess, you can probably wire up Node to act similar to what 
PHP does in a FastCGI setup). Node includes modules that implement the 
functionality of a web server, and frameworks such as Express help you build on 
this capability.

So, if you want to write a web app back-end in Node, you would likely start 
with first using the HTTP module or Express to setup/develop a web server. This 
may feel primitive, and in some sense it is, but it has its advantages when you 
keep in mind that Node is "a platform for building ... network applications”. A 
web server is one such application.

        —ravi



> I don't think I'm saying this because I'm looking at NodeJS as if it were 
> PHP. PHP treats the server as a separate component because it's 
> infrastructure, best kept out of the way unless needed. NodeJS treats the 
> server as a part of the application, for reasons which I expect I'll 
> appreciate in due time, but it's still infrastructure; that's a function of 
> what web applications do, not of what language they're written in.
> 
> What's going on here? Am I somehow unclear on concept? Or have I simply 
> chosen the wrong book?
> 
> -- 
> -- 
> Job Board: http://jobs.nodejs.org/
> Posting guidelines: 
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> You received this message because you are subscribed to the Google
> Groups "nodejs" group.
> To post to this group, send email to nodejs@googlegroups.com
> To unsubscribe from this group, send email to
> nodejs+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en
>  
> --- 
> You received this message because you are subscribed to the Google Groups 
> "nodejs" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to nodejs+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

-- 
-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to