Computing > Programming

Node JS programming for masochists

<< < (4/4)

magic:
If all you know is a hammer...

>:D :-DD

AtomicRob:
Wow, a lot of node js hate... It's a tool, like any tool it's good for some things and not for others. When you run into trouble like this the question to ask is, did we make the wrong architecture/platform choice, or is it the right platform choice but poorly implemented? As a hobbyist or student this is a good learning experience. In a professional setting this is sort of a lose-lose situation. You don't want to go back to the product manager with those two options ;)

nigelwright7557:

--- Quote from: AtomicRob on June 05, 2021, 05:36:20 am ---Wow, a lot of node js hate... It's a tool, like any tool it's good for some things and not for others. When you run into trouble like this the question to ask is, did we make the wrong architecture/platform choice, or is it the right platform choice but poorly implemented? As a hobbyist or student this is a good learning experience. In a professional setting this is sort of a lose-lose situation. You don't want to go back to the product manager with those two options ;)

--- End quote ---

Node JS in my case was a necessity as I needed a none blocking responsive website.
I am not having a dig just relaying my experiences with it.
Its been a few weeks now since starting with it and i am slowly getting the hang of it.
Getting to grips with promises and async/await ok now.
My website is now doing pretty much what I wanted.
I didnt want to use mysql as my cheap web hosting doesnt support it to so moved over to MSSQL.
Took a while to get into it and got stuck a bit on interpreting data from MSSQL.
For some reason they embedded the JSON inside an extra level called recordset which I didnt know about until I stringified the JSON structure to the console.
Still all working well now.
I got in touch with Microsoft over poor JS debugging and they improved it in for me.
At least I now get a list of errors to work from.

filssavi:
While JavaScript and node do have rough spots and downsides, I feel the hate here is totally undeserved

There are examples of fairly large companies that you might know (Netflix, PayPal, Uber…) that make extensive use of nodeJS, so evidently, if the application is architected correctly nodeJS is capable of handling plenty of traffic (now hard numbers are fairly hard to track down, but I am willing to bet that it is more than 10k requests/s). Of course when it comes to true scaling the language the server app is written in does not matter, as long as the infrastructure architecture (where scaling really happens) not have any bottlenecks.

The dependencies problem is absolutely nothing specific to JS, when dealing with security critical code, all the dependencies should be known and trusted. I can just as well copy paste crappy C code full of memory leaks, buffer overflows, and so on, but I don’t blame the C language for it. Moreover all language package management repositories (pypi, npm, etc) are more or less equally vulnerable to supply chain attacks, as they are typically run on shoestring budgets (with respect to their appeal to malicious actors) And cronically understaffed (running the package repo is not that glamour of a job)

JS, is a tool, there are things it is very good at doing like asynchronous event driven programming for strictly IO bound tasks (where having dozens of  threads is only a waste of memory and OS resources, as they will all be blocked while waiting for a DB query to get back) things it is more or less ok at like Purely CPU bound tasks ( where ince the JIT kicks in is not too far Back with respect to C) and things it is absolutely atrocious at, like anything memory intensive, or god forbids memory bound. It is up to the software engineer/architect to choose the right tool for the job

After all theoretically I could build a 20kW inverter with 2n2222 BJT, or an operational amplifier out of discrete high voltage IGBTs. Il would be very difficult and they would have terrible performance, however blaming BJTs or IGBTs for that is childish.

Now if youe boss forces you to do it or you inherit the maintenance of such a thing then yes I would be salty as well, however it still is not the language fault.

P.S. IMHO the OP should slow down and do thing at a time, first learn JS/node and the various modern web standards you need to use, then learn how to deploy your stack in a local machine (either bare metal or VM) and how to automate the deployment. And then and only then you can even start to think moving everything to the cloud, otherwise you are debugging 2/3 completely separate and buggy software components, interacting in unpredictable ways on somebody else’s computer (aka the cloud)

Navigation

[0] Message Index

[*] Previous page

There was an error while thanking
Thanking...
Go to full version