Will Server-Side JavaScript ever catch on?

Craig Buckler
Share

server-side JavaScriptJavaScript is probably the most widely-used programming language on the planet – nearly every website has a few lines. However, the language is also one of the most misunderstood and often confuses experienced developers: it is not Java, it is not “script”, it does not appear to support Object Orientated Programming, and it can be problematical to get code working in one browser – never mind all of them.

Much of the pain experienced by web developers is rarely caused by JavaScript itself; DOM manipulation, browser quirks and, until recently, a lack of good development tools and debuggers are the biggest causes of complaint. However, the rise of Ajax and Web2.0 led many developers to ‘rediscover’ the language: it may not be perfect, but it is powerful and provides compelling features such as prototypes, first-class functions, closures, and object literals.

Whilst JavaScript engines are available in all but the most basic of web browsers, its use has never become widespread on the web server. There are several server implementations of JavaScript but none could claim to have become mainstream compared to PHP, ASP.NET or even Ruby.

However, server-side JavaScript does offer some tantalizing possibilities:

  • It is one less language to learn and use. Web development typically involves a range of technologies and server-side JavaScript would make the process easier (how many times have you started typing server-side code into JavaScript or vice versa?)
  • The same code could be used on both the client and the server, e.g. form fields could be validated using identical methods.
  • JavaScript libraries such as jQuery would work on the server. Features such as server-side DOM manipulation should also be possible.
  • Web service and Ajax development would be easier, e.g. JSON could be natively handled at either end.
  • Knowledge could be shared between server and client-side web development experts.

Is JavaScript the right language for the server environment? Can projects such as Jaxer succeed? Are you using it now or planning to in a future project? Should more ISPs offer server-side JavaScript within their hosting plans?