JavaScript as a server-side language?

jasgrey

Junior Member
Joined
May 27, 2014
Messages
166
Reaction score
240
I've found articles covering JS as a server-side language. Apparently there is a small cult following who believe JS to be able to be a server-side language. I'd like to believe that JS could replace Python or other server-side languages because it would be so much simpler to create a full website (front-end and back-end) with one central language.

What do you think? Could/can Javascript be used for the same functionality of a real server-side programming language?

Although rich web sites and applications have become the norm in recent years, they can still be difficult to develop, maintain, and expand. Many of the challenges stem from the schism between client and server components. Client-side components usually consist of HTML, CSS, JavaScript, Ajax, JS libraries, images, and whatever other files that are to be downloaded to the browser. On the server, you need a listener to process requests, fetch resources or information, and manipulate them so that they can be sent back to the client. This is usually accomplished using XML, JSON, or HTML-Formatted text, which is sent across the wire using Ajax. There are a number of competing technologies to choose from here. Depending on your traffic, hardware, O/S, bandwidth, IT expertise, and numerous other factors, there is a technology for every taste and occasion. Popular server-side languages at this time include PHP, Java, and .NET, to name only a few. There is presently a ServerJS movement whose goal is to eliminate the gap between client and server. Exponents of the group want to keep with HTML, JavaScript, and CSS, which are most familiar to the end-users. What makes server-side JavaScript possible is a web server than can process the code. One such server is called Jaxer. Developed by Aptana, Jaxer is an open source Ajax web server for building rich web pages and applications using a unified Ajax model that can be written entirely using JavaScript.
 
It 's called Node.js - it is awesome and already adopted by giants in the enterprise, posing a direct threat to Java. To even compare its prospects with ... Python ... is an absurdity.
 
To even compare its prospects with ... Python ... is an absurdity.

Why you say that? and what In your opinion is on the horizon that could be better than python?

Cheers
 
Think I read it could be the end of Flash to.

Bloomin hope so!!
 
Why you say that?

Let me give you 2 examples without any fluff:

Yahoo is heavily invested in the future of NodeJS
NodeJS already powers multiple sites, and will soon power most of Yahoo

http://yahooeng.tumblr.com/nodeweekly (yahoo 's engineering blog).

All of our consumer facing web applications going forward will be built on node.js

https://www.paypal-engineering.com/2013/11/22/node-js-at-paypal/ (paypal 's engineering blog)
 
YouTube is written in Python.
Reddit is written in Python.
Google uses Python extensively.
Bank of America is writing the majority of their new stuff in Python.

Nothing against Node, but to dismiss Python out of hand like that is not reasonable. It is proven as a technical foundation for some of the world's most massive sites.
Web programming is also only a single aspect of what Python is good at. It is rapidly growing as an important language for scientific computing.
 
Last edited:
Yup node JS is rocking at the moment and they call it server side javascript. The best thing that I like about it is it's multi-threading capability. As for the developers, it's a new and cool technology and not a threat, but for the people who made other languages might consider it as a threat, not sure :o
 
I do get what your saying, bicycle thief, I love python too, however the reviews of node.js in terms of speed and functionality are more than a little bit exciting.

I have never touched c++ but I have read that we are in that vicinity when describing node.js without the lengthy processes.

I done some node tutorials and a did like the fluidity of bringing javascript to the backend, and giving more depth of use to what I think was already a pretty cool and useful while somewhat limited language.
 
Yup node JS is rocking at the moment and they call it server side javascript. The best thing that I like about it is it's multi-threading capability.

I thought nodejs was entirely single threaded?

Async =/= multithreading
 
Excuse my term I am a nodejs noob :p
Yes, the term is "asynchronous" :o

Execution time should be much lesser than php as I believe. Couldn't give it a try due to lack of time :(
I thought nodejs was entirely single threaded?

Async =/= multithreading
 
Last edited:
Excuse my term I am a nodejs noob :p
Yes, the term is "asynchronous" :o

Execution time should be much lesser than php as I believe. Couldn't give it a try due to lack of time :(

Generally speaking the web server performs better, but that entirely depends on the code that is running. If the code written isnt completely async and blocks in some places (io, database, etc) then it causes the thread to block for longer which can severely impact performance if there are many connections.

Edit: you should find some time for it, you'll be so glad you did
 
Last edited:
YouTube is written in Python.
Reddit is written in Python.
Google uses Python extensively.
Bank of America is writing the majority of their new stuff in Python.

Nothing against Node, but to dismiss Python out of hand like that is not reasonable. It is proven as a technical foundation for some of the world's most massive sites.
Web programming is also only a single aspect of what Python is good at. It is rapidly growing as an important language for scientific computing.

And lots more, no one said Python is irrelevant in today 's landscape. Python was a sensible choice in the past and will still be for a set of use cases, just like PHP isn't going anywhere for the small/mid size business for a loooong time.

My assessment was about the future in the enterprise and as I see it Node 's approach has hit a sweet spot with regards to how the web 's services are evolving. That makes it a natural fit.

That said, obviously Node is not "the one to rule them all" and is definitely a bad choice for some specific things (e.g. CPU intensive stuff). If I was the BoA CTO, I wouldn't swap my C++ core for Node either.

As for scientific computing, I 'm not sure that 's an argument in favor of Python 's bright future, considering people still use ...FORTRAN there :)
 
I thought nodejs was entirely single threaded?

Async =/= multithreading

Your code is run in a single thread . Behind it there 's also a pool of threads (the "event loop") that handles all the IO things asynchronously as far as your code 's flow is concerned.

That 's the beauty of node 's architecture, it provides multithreaded advantages morphed into a single threaded form (poetic license, this isn't the proper technical description), which is much easier to work with .
 
Everything you can do in node.js you could do years ago with python twisted/tornado . All of the hype surrounding node.js right now is due to the fact that you can write all your server/client code in one language which has opened the door to many front end only devs to quickly produce backends as well, does that make it great though? Nope, just makes the barrier to entry a lot easier hence the gazillion Web designers who have magically become full stack devs overnight since the inception of node.

For me personally, node.js didn't live up to the hype for backend development. Been a year or so since I cheked it out but it just wasn't mature enough at the time, huge shortage of good libraries when compared the python or .net world. If/When I need async/parellel support on the server I'd rather opt for something more well suited for the task like like F#.

In the end, if you do choose to go the node.js route, make sure you take a look a coffeescript. Takes a lot of the headaches out of maintaining a javascript codebase.

Also, meteor.js seems like an interesting framework to play with.

I myself am planning to spend some time learning angular.js for client side development in the coming months. http://channel9.msdn.com/Events/Build/2014/3-644 Really cool stuff. Mixed with one of the Baas providers like firebase building simple real time crud apps should be a cinch once you get the hang of it.
 
That's a good post I must say. I got started with angular JS too. Seems pretty interesting.
Everything you can do in node.js you could do years ago with python twisted/tornado . All of the hype surrounding node.js right now is due to the fact that you can write all your server/client code in one language which has opened the door to many front end only devs to quickly produce backends as well, does that make it great though? Nope, just makes the barrier to entry a lot easier hence the gazillion Web designers who have magically become full stack devs overnight since the inception of node.

For me personally, node.js didn't live up to the hype for backend development. Been a year or so since I cheked it out but it just wasn't mature enough at the time, huge shortage of good libraries when compared the python or .net world. If/When I need async/parellel support on the server I'd rather opt for something more well suited for the task like like F#.

In the end, if you do choose to go the node.js route, make sure you take a look a coffeescript. Takes a lot of the headaches out of maintaining a javascript codebase.

Also, meteor.js seems like an interesting framework to play with.

I myself am planning to spend some time learning angular.js for client side development in the coming months. http://channel9.msdn.com/Events/Build/2014/3-644 Really cool stuff. Mixed with one of the Baas providers like firebase building simple real time crud apps should be a cinch once you get the hang of it.

@thread
Not sure, but when I first saw the video, the creator said that it wasn't too easy to debug the code bottlenecks back then. Has that improved? Would appreciate your expert opinion on that.
 
That's a good post I must say. I got started with angular JS too. Seems pretty interesting.


@thread
Not sure, but when I first saw the video, the creator said that it wasn't too easy to debug the code bottlenecks back then. Has that improved? Would appreciate your expert opinion on that.

I have not had time to get started with angular as of yet but I am pretty keen on having a chance to dive into it.

The framework seems to have matured quite rapidly though, there's full support for it in both Visual Studio and Webstorm with a few different default templates to start from in both ides.

There's also a google Dart version and loads of angular tutorials online to get you started.

https://www.codeschool.com/code_tv/angular-js-part-1
http://www.codecademy.com/courses/javascript-advanced-en-2hJ3J/0/4
http://courses.tutsplus.com/search?search[keywords]=angular
http://pluralsight.com/training/Courses/Find?highlight=true&searchTerm=angularjs

Also, do check out http://angular-ui.github.io .

Good luck with Angular, seems to me the future of building RIA's.
 
I hope nobody minds if I resurrect this thread. It's not too old.

I spent most of the last month and a half toying around with different languages. I dove into Python, swam around in a little PHP, gave Ruby a whirl, and also experimented with JavaScript. To be honest, JavaScript was the one that clicked the best with me. Also, in this time I have done quite a bit of design work and taken my design skills to a whole new level. (I still need practice, but comparatively, I'm 500% better than I was.) Being a designer, JavaScript is something I need to become fluent in anyways, so Node.Js, if it lives up to what I have read, may be a life-saver for me.

just makes the barrier to entry a lot easier hence the gazillion Web designers who have magically become full stack devs overnight since the inception of node.

^I'm banking on this.

That being said, having a basic grasp of JavaScript and a little bit of jQuery, I think that progressing with JavaScript and it's libraries is going to be my new hobby that may one day net me some profit. I'm not banking on the profit so much, but I've had so much fun working with basic JavaScript that it now actually bores the hell out of me to open up Photoshop or Illustrator. I want to continue in my learning, but I want to be assured that in learning JavaScript (and Node.Js in time) I can build full websites without having to start from scratch back in PHP/Ruby/Python. --If I ever do acquire clients for web design, I don't want to lose them because they want more than a static and interactive website. I don't want to lose them because I can't build them a site that allows their users to sign up and carry out what the site was dreamed of allowing them to do. I don't want to lose them because I can only make a pretty website that has an image that will grow 10% of it's size when you hover your mouse on it. -_-

So, if there are no objections. Let's revisit this a little bit.
 
Let me give you 2 examples without any fluff:



link (yahoo 's engineering blog).



link (paypal 's engineering blog)

well i think yahoo and paypal are interested in nodes.js because both have apis that heavily relies on javascript for tracking/ ad placement etc
so they are trying to implement that to speed up they existing code base, so nodes.js is the "right" technology for it but it might not be the best choice
for other business models

i can't post links yet but search for "quora Why did Koding switch from Node js to Go"

i love python and webpy myself and, like any another language, you can code almost anything using python the only downside of python web programming is hosting prices
 
well i think yahoo and paypal are interested in nodes.js because both have apis that heavily relies on javascript for tracking/ ad placement etc
so they are trying to implement that to speed up they existing code base, so nodes.js is the "right" technology for it but it might not be the best choice
for other business models

i can't post links yet but search for "quora Why did Koding switch from Node js to Go"

i love python and webpy myself and, like any another language, you can code almost anything using python the only downside of python web programming is hosting prices

I read the article and the conclusion is that guys at Koding screwed up their code.

I also became interested in Node.js recently and am only thinking about this for one reason: to write everything in JS.

While JS is completely ugly language IMO, it cannot be avoided on the client side and therefore I think that using it on server side is not such a bad decision.

The other plus for Node.js is Paypal: those guys aren't stupid and their experiment shows everything went better when switching to Node.js. This, by itself,
could be a valid reason to try this thing out on a serious project.
 
Back
Top