Netscape Enterprise Server and Server-Side JavaScript (SSJS) vs Node.js

前端 未结 2 1629
自闭症患者
自闭症患者 2021-02-15 14:02

What are the major differences between the Netscape Enterprise Server implementation of Server-Side JavaScript (SSJS) and the node.js implementation?

Why did Netscape\'s

2条回答
  •  终归单人心
    2021-02-15 14:43

    Back in 1999/2000, I used to work at a company that used Netscape Server and SSJS. I don't know how popular it was at the time, but from first hand experience, I can tell you that almost everything about it was terrible:

    • It was a giant pain to debug (any changes to source files, even static files, required full reloading of the application, which was not a fast operation)
    • A simple error (such as an uncaught exception) often would lead to catastrophic server failure. Somewhat amusingly, this is the default behavior of NodeJS, although it is much easier to get around this problem with Node.
    • Although the syntax was JavaScript, it failed to implement one key advantage of modern JavaScript: runtime interpretation. Server Side JS with Netscape Server required compilation before deployment, and therefore dictated a very slow development process.
    • It followed a multi-threaded execution model (rather than modern JS VMs, which are almost always event-loop based)
    • Possibly it's biggest weakness was a lack of asynchronous programming support. All IO operations were blocking, and as such it required a heavyweight multithreaded model to support multiple clients. The execution model was more similar to a J2EE container than to modern event driven JavaScript VMs (ie: V8). In my opinion, this is the number one thing that NodeJS gets right: the async philosophy is deeply embedded in the NodeJS development workflow and it is the key to its lightweight, event driven, extremely efficient concurrency model.

    Just for giggles, here's a link to the SSJS reference guide from version 1.2 . Starting on page 21, you can see all the standard functions and synchronous APIs for file objects, database queries, etc...

    My company ended up switching to ColdFusion shortly thereafter and never looked back.

提交回复
热议问题