20

I started learning Node.js this morning. Wow, mind blown.

I can see how I could use this in an existing web development project.

What are the barriers to using Node.js instead of something else? Are there support/performance issues?

Comments
  • 14
    Your website including images will be 1MB and node_modules will be 200MB :🙂🔫
  • 7
    @gitpush we should also let him know that node_modules is not going to be included in production.
  • 7
    @tahnik and also not pushed to source control
  • 7
    Node is an issue if it is being used actively in a project were a lot of junior devs are involved. There are a lot of principles behind it which need to be understood additionally to understanding JS very well (prototyping etc.) Otherwise it will lead to a lot of memory leaks and long waiting times for trivial things.

    Stability is another point you need to consider. Windows is not a very good friend of node when doing development as it produces some disasters in terms of used memory.

    Changes. Changes every. The development of node is continuously. You need to pay attention to LTS versions, decide if you want to use the cutting edge features of the stability of an older version.

    The most important part of using node as a web server: it is single threaded. If someone writes an endpoint which contains an infinite loop (for the sake of example) then no users can use any endpoint from the app. Have a look here: https://pastebin.com/huU2xyuH
  • 5
    @tahnik actually node modules will be included in production of it's a server side project, say a web server. But still, who gives a fuck about disk space? This isn't 1995, disk space should be the least of your worries

    True about source control tho
  • 1
    oh yay, 1 thread is plenty for an app in 2017 -node devs
  • 0
    @BindView Thing is, that one thread will get much more done than one thread in a sync language.
    My one threaded node app can make 2000 requests wait for all responses and save them to disc in 5 seconds...

    Also you can easily spawn multiple node processes so I don't see the problem really
  • 1
    For someone who used with JavaScript. It's pretty much relatively not so hard to learn nodejs .

    But for juniors. I think we need to guide them since NodeJS may be hard for them
  • 4
    @Artemix: I tend to agree with you, but I strongly disagree at the same time.

    Node is not a piece of shit, it is just another "tool" in the development lifecycle. If someone uses it as something it was not supposed to do (yes, node is not a web server and it was not made for heavy cryptography) then it's not node's fault.

    Everything is perfect in their context. It's not node vs Java as you cannot ask an electrical engineer: "What do you want to use from now on? The hammer or the screwdriver?"
  • 3
    @Artemix: i do understand you, but you reaction was a little bit provocative. I understand that there are some frustrations (not yours, but general) around node and JS especially.

    Node can do a lot of good stuff. You just need to understand what are those good things and where you should not use it.

    "because that shit will never run a fully-fledged enterprise service". I beg to differ. I met a lot of fully-fledged enterprise services running on node :).

    Dependencies are something you decide if you want to use or not. It's the same thing with Java and packages. It's the same thing with any other dependency-based project. You can mirror npm repo if you want. Doing so will enable you to have whatever package you want.

    PS: Node is not slower than PHP5 + Apache. It is not slower than Java + Tomcat/JBoss/WebLogic. It is just different.
  • 1
    So, basically, it has potential but it's probably not the most efficient solution at the moment?
  • 2
    @m0fo Thanks for your perspectives!
  • 2
    I agree with everything @m0fo said.

    @Artemix you are blindly hating node.

    "that shit will never run a fully-fledged entreprise service" - Netflix, Paypal, Ebay, Medium all uses NodeJS.

    And why are you so worried about dependencies? Most of the core dependencies will be maintained for a long time. It's how node works.
  • 1
    @MonsieurMan thanks, I see it as an extension of the client-side JavaScript I've been learning. The more I learn, the more exciting it is to me.

    I'm also pretty keen to return to learning Python. I started learning Python 2.7.x earlier this year. I want to go back to the beginning and learn Python 3. I think I forgot most of what I managed to retain.
  • 2
    Mate stop jumping from a tech to another. An easy way to achieve a stability as a developer from my perspective is: learn HTML5 (focus on understanding how to achieve things easier rather than remembering tags), CSS3 (with one of the pre-processors variation: SASS, LESS, Stylus, PostCSS + cssnext) and JS (if you have some insights about programming, get JS The Definitive Guide), incuding ES6. After understanding inheritance, prototyping, event looping and the principles around JS, read about StencilJS and write the UI of an online shopping cart using mocked data. You will meet with TypeScript, web-components, SPA principles, JSX. Stencil is great because it has React-based syntax, virtual dom, angular-like decorators and the bootstrap is pretty easy to install.

    After that move to the backend for writing a simple api system to serve the UI. You can use node since you will be familiar with it. Don’t overcomplicate things, keep them as simple as possible.
  • 3
    The above represents my oppinion. That’s how i train my guys. I found it to be a simple way to introduce someone to web development without removing his hair with a box glove. The explanation behind it is simple: giving them a roadmap and a visual output of their work, they begin to gain interest much faster.
  • 1
    @m0fo thanks, that's sound advice. I'll curb my curiosity!
  • 1
    Learning node also helps open you up to a host of different front end frameworks such as angular which is very in at the moment, and probably will be for a long time.

    Also, Node is not necessarily slow and someone has managed to get that single thread to manage 1M concurrent connections at once before. 1M.
  • 1
    @craig939393 Thanks, it sounds like I really should just focus on developing a solid understanding of Planet JavaScript and Node before rushing back to Python or starting PHP.

    Not so easy for me. So many new things to learn and use ... 🌈
  • 3
    @wiredgecko Don’t rush to PHP. Next, i would continue to consolidate my knowledge and explore the ‘strange’ world of programing languages. C# is quite close to JS and TS (it has ‘var’, the syntax is not extremely rigid) but lacks solid support in cross-platform war. Java is widely used but it might produce some shocks due to the rigid syntax. Starting with Java 8 they began to introduce good support for functional programming and it got a lil’ bit better.
  • 1
    @m0fo From the little I understand about those languages, I suspect that they will take me in a different direction.

    At the moment, I'm more focused on web development than native app development so JavaScript + Node (obviously); PHP for WordPress and, eventually, Laravel; and Python for what I understand could be supporting backend services.
  • 0
    Surprised no one has mentioned Go 😛
    Always seems there’s someone preaching Go
  • 1
    @Artemix I don't think you understand how Node.js works. All those calculation heavy things can be offloaded to another process. I haven't worked on huge node.js projects but seeing how companies start using it it seems less of a problem with node.js and more of a problem with developer skill.

    As for a zillion dependencies. I think the whole node_modules meme is overrated. Even on a VPS it's not a problem to have your app take 100MB of disk space since the lowest of tiers already usually offers more. You'll more likely run out of performance in your tier than disk space these days.
    Anyway, I'm not saying node.js is the best all and end all of web servers. But it is a good one and should not be ignored.

    Ah and Node.js never running on big servers? Yeah... tell that to PayPal, Netflix, Microsoft, eBay, Groupon and many others
  • 0
    Now that I think of it... I think I know why @Artemix hates node so much. Look at his/her shirt... Guess whose jobs Node is taking over 🤣
Add Comment