Using Node.js for Everything

preview_player
Показать описание


Рекомендации по теме
Комментарии
Автор

i started node.js last week and i love it. still learning but for people like me who use JavaScript all my life and now i can do it on server side it's amazing.

KROLOV
Автор

I don't understand all of these people whining about Javascript and Node.js, it honestly isn't that bad, and unlike Java, C#, PHP, Python, or your favorite mainstream language of choice, you actually need it to write web applications. It is the C of web applications.

Sure, JS /node is not a masterpiece, but it's not like people here are suggesting Haskell or Prolog as an alternative. If anything, they just want to whine that it isn't like Java or C#, and many of those people would balk at any non-Java like language used at work that doesn't work with their favorite IDE, because the new language is not ridiculously verbose and different from their comfort zone.

All the people whining about dynamic typing in JS probably never were proud enough to rant about Python, Ruby or Lisp to their colleagues, so are they so ready to boast about their inflexibility when there is a prestige factor involved in using those also mediocre languages. JS has a lot more stuff written in it, and it was incredibly easy to learn, so I don' t understand why it gets so much hate.

bobwps
Автор

Whey and where do we need to decrypt SSL? You mentioned that it is CPU intensive job so it can't be handled efficiently by Node.js. Why?

Muhammad_Hannan
Автор

Node is my language of choice for robotics. The simplicity, flexibility, the async low level api, high single threaded performance, and new ECMAScript 6 standard, is why I do so. It is great for semi-real-time operations along with handling high level apis like websockets and http.

KhalilEstell
Автор

I would've liked the Q&A section :(

nepoxx
Автор

You can use node for everything, but I question the wisdom of doing so.  I've found that node is great for smaller microservice type of projects that are only a handful of modules.  It is easy to get something working quickly and most of the things you need are there.  I find it much easier than setting up Java and .Net projects.  If I had a tight deadline for getting a RESTful service up (i.e. a couple days), I'd choose node over just about anything else.

However, it completely falls on its face once projects get large.  Basic developmental tools that Java/C# devs have become use to simply don't exist or work correctly in the JavaScript world:

Without types, the code is not self documenting (i.e. what type is that parameter to that function?).  In many cases it requires running a debugger to inspect parameters at runtime because the information simply is not available in the code as in other languages.

Auto-complete is a big pile of fail in JavaScript IDEs....doesn't work correctly in JavaScript files because it can't figure out what is what due to the dynamic nature of the language.  Usually JavaScript IDEs show a bazillion choices in the drop down or none of the right ones.  And for the view layer (i.e. dust files), you simply don't get auto-complete at all because it has no clue what properties are on your model objects.

Refactoring is also a big pile of fail in JavaScript IDEs.  When you have multiple modules with the same function names, referenced in hundreds of places, using the refactoring features of JavaScript IDEs to rename one of them is a sure fire way to completely hose your codebase.  Unless your refactoring all happens within a single module, it is a manual process if you want to do it correctly.  Refactorings that took minutes in Java/C# can take hours or days to do in JavaScript.

Code navigation is a big pile of fail in JavaScript IDEs also.  Things like 'Go to definition' simply don't work correctly.  Usually JavaScript IDEs will show a list of things that you 'might' want to go to with that same name.  i.e. right click on a toString() function and try to go to definition.  In many cases when it can't figure out the type it just guesses and shows a huge list of possible toString() implementations, usually none of which are correct.

And then there is the hacky architecture of Node itself.  Since it doesn't support threads, you have to spawn and manage multiple processes yourself to take advantage of all CPU cores.  Modern Java frameworks like Vert.x take a different approach by implementing a multi-reactor.  On a quad core computer, Vert.x will spawn 4 threads, each thread running a separate reactor, all within the same JVM.  No OS signals need to be sent between processes, etc. like node.

Then there is the problem of native code being used all over the place in node modules.  This brings back all of the nasty platform specific problems that Java solved years ago and makes supporting multiple operating systems a pain.  Node is NOT multi-platform friendly.

You can get around some of these problems by using TypeScript.  But it introduces a whole new set of issues you have to deal with in terms of transpiling, debugging, module definition, type definitions that are out of sync with they libraries they are wrapping, etc.  However if you're on a Node platform, TypeScript is definitely better than ECMA 5 JavaScript in many regards, and results in cleaner, easier to maintain code.

In the end, you certainly can succeed using node for everything.  Many would argue however, that you can succeed better over the long term with one of the compiled languages (i.e. Java/C#) using modern async frameworks such as Vert.x, Play Framework, ASP.Net 5, etc.

michaelm
Автор

Well, interesting.  One thing that kept coming to my mind during his talk was Erlang.  The let it crash, minimise state, keep it simple, unit test early are right out of the Erlang/OTP play book. One thing that Erlang can't match is 70, 000 packages. 

edmaphis
Автор

What IDE is that at 4:17? Can you recommend a cloud based IDE that's good for developing  node.js that that will be deployed on Azure Web Sites. I'm trying out Cloud9, but finding documentation does not seem to work on the most recent release.

vLife
Автор

I'm having trouble installing node. before it reaches the end of the installation it pauses and stays that way. I'm not sure what the cause of it is but can't anyone help me out? I'd appreciate it alot, thx.

jefftheposter
Автор

Charlie is using exaggeration to make his point. He's mainly referring to fast moving startups that need web apps spun up as quickly as possible, at the same time making the case that you COULD use node.js for everything. The latter makes sense from a mere possibility standpoint, but quickly breaks down in light of specific industries and market verticals. Quantitative Finance: forget it - you'll need to use C or C++ for the performance. industrial automation: I've used the MEAN stack for HMIs, but the back end had to be .NET or C++ for performance, ease of debugging, strong typing and stability. So I'm not biased here, having used node.js extensively, just making the case for truly understanding the scope of the discussion. The use of the word "everything" invites unnecessary controversy, IMHO, but listen at 7:56 - Chris outlines their approach to using node.js internally at Modulus - if we're given a reason not to use it, we won't.

mcafazzo
Автор

hello, i need to run my node server by pressing a button in my client side, and save all the execution states of my node in a log file instead of the console, how can i do this, i need your advices.

fatimazboujrar
Автор

Why would I possibly choose node over golang?

nenenartey
Автор

If creating an Agar.io like game on Node would it be able to meet possible traffic demands similar to that off what Agar.io got? Or would you run into problems?

dustinbaker
Автор

Is this company still around? looked for their url and looks like a different company

sikz
Автор

When is restify a better option than express or hapi

Cdswjp
Автор

JavaScript really is the most flexible language now. Use it on the front end for interactive UI and backend for a REST API with image processing, database manipulation, encryption... everything you need. It's so easy to just throw JSON between the client and server and have it look the same on both ends. Note: JavaScript is a TERRIBLE language, but CoffeeScript is the perfect solution if you have a good grasp of vanilla JS.

dinner
Автор

To him with only a node.js, everything looks like a WebPage.

RogerBarraud
Автор

It would've been cooler if they had just named the company 'Nodulus'

atmuukjg
Автор

Did you ever use a node addon to handle encryption?  I was able to handle signing pretty fast.

jimgibbs
Автор

What is his sublime text theme? it looks great.

pankajdnb