ServerJS/FAQ: Difference between revisions

prototype-based vs class-based
No edit summary
(prototype-based vs class-based)
 
Line 9: Line 9:
Debugging compiled code is not an enjoyable experience. Often, the abstraction layer between language X and JavaScript also has some holes then you end up needing to plug with hand-crafted JS (and not just stock JS, but JS that is designed to interface with that library). By using JavaScript all the way across, there are no such leaks.
Debugging compiled code is not an enjoyable experience. Often, the abstraction layer between language X and JavaScript also has some holes then you end up needing to plug with hand-crafted JS (and not just stock JS, but JS that is designed to interface with that library). By using JavaScript all the way across, there are no such leaks.


Also, there can be some impedance mismatch between the prototype-based object model in JavaScript and the object models of other languages.
Also, there can be some impedance mismatch between the prototype-based object model in JavaScript and the class-based object models of other languages.


=== Is there a bonus reason to use JavaScript on the server? ===
=== Is there a bonus reason to use JavaScript on the server? ===


Why yes, I'm glad you asked. JavaScript is powering increasingly complex applications in the browser. This has caused browser vendors to work hard on their JavaScript performance. Server side JavaScript has the potential to significantly outperform other common dynamic languages because of this work.
Why yes, I'm glad you asked. JavaScript is powering increasingly complex applications in the browser. This has caused browser vendors to work hard on their JavaScript performance. Server side JavaScript has the potential to significantly outperform other common dynamic languages because of this work.