Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does it make sense to build pure JavaScript based web applications (both client and server side)? [closed]

I've always considered JavaScript as a great addition (or rather, for the last couple of years, as a must have) to the client side of any web application. Even when I started to use Mootools, which takes a big step away from DOM manipulation, and aims toward a general purpose, OO framework, I still didn't think that I would consider using JavaScript for server-side development. JavaScript belongs to the front, period - that's what I thought.

Well, it seems like according to some damn smart people, I was wrong. For the first time ever, the web development platform contest called Plat_Form accepted a team that used pure JavaScript both on the server and the client side. What's more, here is what the contest organizers had to say about this:

"We had a single application of a team, Upstream Agile, that will work with JavaScript on both the server and the client side. Since this might become a major trend in coming years, we consider their participation a glimpse of the future and accept this team even though no others with this platform have applied."

So my question is: is this really a viable concept, to build multi-tier web applications purely on JavaScript? If so, what would be the advantages of using JavaScript for both the front- and the backend?

EDIT: The link in Vanwaril's answer (Why node.js is totally awesome) reveals an interesting discussion in the comments section that worth reading through. I, for one, have decided that though using Javascript on the server side is a viable concept and might have its benefits, I would definitely not start building an enterprise application with that architecture. At least for now. This question might need to be asked again in a year, I can imagine that the answer will dramatically change in the near future.

like image 745
András Szepesházi Avatar asked Feb 08 '11 10:02

András Szepesházi


People also ask

Why is it beneficial to use JavaScript for both client-side and server-side development?

Running JavaScript on the server allows your developers to work on both frontend and backend. They will know the entire project much better and altogether avoid the communication overhead between separate teams. They can implement every feature from start to finish by a single developer.

Is JavaScript used for server-side or client-side?

JavaScript. JavaScript is a client-side script, meaning the browser processes the code instead of the web server.

Can you make a website with pure JavaScript?

No it is not possible. You can even make a website with HTML only but it doesn't make sense. You need CSS to adjust appearance of your website and JavaScript for animations and interactions.

Can JavaScript be used for client-side programming?

For a long time, the primary use of JavaScript has been for client-side programming. So when you see a button, text, or any object moving on a web page, it is most likely a result of JavaScript code. JavaScript has become very powerful and is no longer a web-only programming language.

What is an advantage of using server side JavaScript?

A server-side rendering benefit is the reduced dependency on JavaScript frameworks, resulting in a reduced page weight. Furthermore, JavaScript files can significantly add to the overall page weight. It's not uncommon for a suite of JavaScript libraries to be over 1 MB in size.


1 Answers

First off, have you taken a look at node.js? JavaScript is one of the languages that, over the last few years, has seen leaps and bounds of development, and its likely to keep growing.

In terms of functionality, it is less mature when compared to other server-side technology, but the active community is making it not far behind.

Finally, since its a language that runs on both the front and back-end, its implications for code-reuse and data-exchange formats make application development a whole lot faster.

I'm not sure its quite ready for production yet (unless you yourself are willing to contribute to the code-base) but server-side JavaScript is a good option to experiment with.

like image 97
Vanwaril Avatar answered Sep 20 '22 15:09

Vanwaril