JavaScript on the server side? Why not?

P

Peter Michaux

Hi,

I might be turning a corner today and seeing the light. I might still
be confused :)

If JavaScript is the language for the browser then why do servers use
Ruby/Rails, Perl/Catalyst, Python/Turbogears or PHP/Cake? Is it because
the prototype-based language is too different to be chosen except when
necessary. Is it because browser bugs make people think JavaScript is
bad? Is JavaScript not suitable for the server-side for any reason?

I imagine that if server-side programmers started to learn JavaScript
then the client-side code in the world might start to improve.
Translation layer libraries like Prototype.js or Mochikit wouldn't need
to exist. The more I learn about JavaScript the more I like it. It is
difficult to learn however for multiple reasons.

Peter
 
E

Evertjan.

Peter Michaux wrote on 03 nov 2006 in comp.lang.javascript:
Hi,

I might be turning a corner today and seeing the light. I might still
be confused :)

If JavaScript is the language for the browser then why do servers use
Ruby/Rails, Perl/Catalyst, Python/Turbogears or PHP/Cake? Is it because
the prototype-based language is too different to be chosen except when
necessary. Is it because browser bugs make people think JavaScript is
bad? Is JavaScript not suitable for the server-side for any reason?

I imagine that if server-side programmers started to learn JavaScript
then the client-side code in the world might start to improve.
Translation layer libraries like Prototype.js or Mochikit wouldn't need
to exist. The more I learn about JavaScript the more I like it. It is
difficult to learn however for multiple reasons.

Javascript in the version of MS jscript has been and is a trusted way of
doing serverside coding on a ASP platform.

Where traditionally many ASP programmers use VBscript, they do not know
what they are missing.

Example:

<%@ Language=JScript %>
<html>
<body>
<table border=1>
<tr><td>n<td>n squared
<%
for (var i=1;i<11;i++)
Response.write('<tr><td>'+i+'<td>'+i*i);
%>
</table>
</body>
</html>
 
K

Kevin Darling

Peter said:
I might be turning a corner today and seeing the light. I might still
be confused :)

I"ve been using JS on IIS for years. Much easier for me to use the
same language on both the client and server.

For rapid development, we use a JScript-based server emulator that
grinds through tons of XML and XSLT to produce HTML pages depending on
the input request it got. This is about 3 pages of Javascript running
locally on a developer's laptop that, through semi-hardcoded response
data, emulates many pages of Apache/Blaze code running on monster
servers. Thus we're able to produce and test code very rapidly vs
deploying it to an actual server, resetting Websphere, etc.

We also use .js script files when deploying lots of code to laptops,
for WMI etc.

It's great stuff.

Kev
 
J

Jeremy

Peter said:
Hi,

I might be turning a corner today and seeing the light. I might still
be confused :)

If JavaScript is the language for the browser then why do servers use
Ruby/Rails, Perl/Catalyst, Python/Turbogears or PHP/Cake? Is it because
the prototype-based language is too different to be chosen except when
necessary. Is it because browser bugs make people think JavaScript is
bad? Is JavaScript not suitable for the server-side for any reason?

I imagine that if server-side programmers started to learn JavaScript
then the client-side code in the world might start to improve.
Translation layer libraries like Prototype.js or Mochikit wouldn't need
to exist. The more I learn about JavaScript the more I like it. It is
difficult to learn however for multiple reasons.

Peter

See Whitebeam:

http://www.whitebeam.org

Jeremy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,430
Messages
2,571,676
Members
48,796
Latest member
Greg L.

Latest Threads

Top