Jump to content
MakeWebGames

Node.js


Spudinski
 Share

Recommended Posts

I've sub-recently began to learn Node.js, and wonder who else here uses it(on a day-to-day basis) as well.

Here's a (rather) short fact list:

http://nodejs.org/

http://en.wikipedia.org/wiki/Nodejs

What is it?

Node.js is a platform built on Chrome's JavaScript runtime for easily building fast, scalable network applications. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices.
- http://nodejs.org/

What is it, really?

It is a single-threaded environment that is still very new to the web industry. Some people think it's the next best thing to come to the web since Ajax.

From an outsider's point of view, it's server-side Javascript. But to an insider it's an low-level development language... in Javascript.

The twist to how it can be so powerful, is, as mentioned the V8 JS engine. The reason why people think it's so powerful is because you can use it for anything that you would've done in most other languages, you can even write drivers because of it's low level implementation.

Who is it for then?

To be honest with you: it's new, it's got bugs, and it's Windows 3.1 style looped.

The applications you will write is going to have to be very well planned out if you consider using it online somewhere.

Example: An error occurs that halts the application. Because the application is the webserver, you are immediately offline.

The other thing, much like PHP deals with raw information, Node does as well.

You will need to know your application and presentation layers well in order to have any basic understanding of how to design your applications.

Why do I love it?

- It's Javascript.

Pure, no jQuery/MooTools/Dojo Javascript. Yes, you can "add" jQuery, but FFS - don't.

- npm

Much like Ruby/apt/rpm, a package manager.

- Asynchronous design

No more waiting, we want it now. This makes it much faster than most other server-side languages/platforms.

- Real time applications.

It's easy to make such applications. Browsers and servers can finally have a communal conversation.

Why does some other guy think it's totally awesome?

http://chetansurpur.com/blog/2010/10/why-node-js-is-totally-awesome.html

For me, it means being able to write networked applications that operate in real time.

This might mean a lot more to me than it might do to you, but from my standpoint it's the best thing since ...HTML5.

I can definitely see a few RPG's running on Node.js once it grows a little, since it's features are perfect for game developers.

Link to comment
Share on other sites

Well it's not the first time we see javascript on the server side. Netscape Server was if I remember right, the first one to use it. Long long time ago... And guess what? It died.

Now why I think it's not good? Because javascript is not a good language. It is like a mix of things and it somewhat works, but I certainly don't like it. I mean, sure I like what kind of results you may get, but I still find it ugly and feel all the time like hacking instead of coding. Classes? No it's all about functions. Variable scope? Be careful as they can either be local or global... without much warnings. Etc.

Sure there is advantages to avoid to switch languages for the back-end / front-end, but then why choose an ugly language? Would be more time to come with something a bit better in my opinion.

For the "real time" communication, I don't see how this change anything, I mean, if the browser support some kind of communication then the server can implement it, and this is not dependent of the language you use to code it. If you think about web sockets (I still need to see real applications of it), which would be the right choice for communication, then you can really implement it in whatever language you want. So somehow I'm lost about why I would need to pick javascript on the server side.

As a coder point of view, I prefer a mature platform, something which offer all the tools to deal with database, pre-made components which are re-usable, and fast coding instead of taking yet another possible tech which may well disappear in a couple of year, without a good IDE, without support of the things I need to do (which would mean do all yourself).

Fast? Well... fast doing what? And... for my own needs, I never had issues with .NET, so no it is hardly a seller point. Sorry.

BTW async operations are already possible with .NET ;)

http://msdn.microsoft.com/en-us/library/hh191443(v=vs.110).aspx

I would suggest you to read (all):

http://teddziuba.com/2011/10/node-js-is-cancer.html

Not saying it's purely evil. I'm just saying that for myself I don't see it good. And JS on the server is not new. However that's my personal opinion and seeing people checking things is always good as it allows us to see / learn new things.

Link to comment
Share on other sites

Well it's not the first time we see javascript on the server side. Netscape Server was if I remember right, the first one to use it. Long long time ago... And guess what? It died.

Now why I think it's not good? Because javascript is not a good language. It is like a mix of things and it somewhat works, but I certainly don't like it. I mean, sure I like what kind of results you may get, but I still find it ugly and feel all the time like hacking instead of coding. Classes? No it's all about functions. Variable scope? Be careful as they can either be local or global... without much warnings. Etc.

Sure there is advantages to avoid to switch languages for the back-end / front-end, but then why choose an ugly language? Would be more time to come with something a bit better in my opinion.

For the "real time" communication, I don't see how this change anything, I mean, if the browser support some kind of communication then the server can implement it, and this is not dependent of the language you use to code it. If you think about web sockets (I still need to see real applications of it), which would be the right choice for communication, then you can really implement it in whatever language you want. So somehow I'm lost about why I would need to pick javascript on the server side.

As a coder point of view, I prefer a mature platform, something which offer all the tools to deal with database, pre-made components which are re-usable, and fast coding instead of taking yet another possible tech which may well disappear in a couple of year, without a good IDE, without support of the things I need to do (which would mean do all yourself).

Fast? Well... fast doing what? And... for my own needs, I never had issues with .NET, so no it is hardly a seller point. Sorry.

BTW async operations are already possible with .NET ;)

http://msdn.microsoft.com/en-us/library/hh191443(v=vs.110).aspx

I would suggest you to read (all):

http://teddziuba.com/2011/10/node-js-is-cancer.html

Not saying it's purely evil. I'm just saying that for myself I don't see it good. And JS on the server is not new. However that's my personal opinion and seeing people checking things is always good as it allows us to see / learn new things.

Classes? Yes, it has.

Variable scopes? Yes, you just need to use the variables correctly.

Ugly? Never, I don't see how JS is ugly.

Real time? Let's take a similar scenario Facebook once had.

For their live comments, it would've been too much strain on the servers to use a pull method. What they did was instead of the client(users) looking for new data, they simply broadcast the data to the users.

They used a commercial application, Node can also do it.

Things like protocol server(like IRC) can be created with Node.

It is relatively new, so it's not what I would call a stable language. But, it does make code re-usable. There's also tons of modules via npm.

As for speed: You know ngnix right?

100 concurrent clients1 megabyte response

 

node 822 req/sec

nginx 708

thin 85

mongrel 4

I doubt a .NET (especially C#) application could match that on *nux.

Link to comment
Share on other sites

I told you, it's my opinion, my impression...

For the ugliness of Javascript, again question of taste. I do find it really... an hack language. Even worse than PHP. Where Java, C# are the clean kind... Javascript allows all and nothing. Without having true classes, true inheritance nothing. It's more like working with structures in C and pointers to functions.

Link to comment
Share on other sites

Wow Spud, I think you have serious control issues.

What is this forum becoming - don't have the same opinions as Spud and get flamed?

You get too involved with your own opinion - the hint is there, YOUR OWN - not everybody elses.

You are behaving like you created the damn thing and you have been personally offended!

Got me there. :\

My apologies if I came across offensive.

Link to comment
Share on other sites

  • 10 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...