I recently started writing a path-finding algorithm simulation application in python.
It takes user inputs, randomly generates a 2d graph, and shows displays the simulation via GUI.
Now, what I found was that Python, and stand-alone applications aren't very appropriate for sharing this kind of application, as you need to get people to run it on their own computer etc. It would be much more convienient to simply direct them to a website.
Obviously the display and control elements need to be written on the client side.
But the actual path finding algorithm could be written on either the client or server side.
Now, given that there's no need for a server side backend (ie. no database), it would be possible to do the entire webapp in client side HTML/JavaScript.
The question is, is there a good reason not to do this?
The way I see it, doing it client-side only would greatly reduce the complexity, because there's no need to handle on going interaction between the client and the server. The only thing the server is for, is to initially serve up the Javascript to the client.
On the other hand… I'd have to write the entire thing in Javascript…
Also, the idea of having a reusable model module appeals to me. Eg. If I want to later have a standalone application, I'd just need to write the View/Control modules.
I'm wondering what generally the accepted practise would be here.
Best Answer
You've outlined the pros of doing the app client side only. Here are some possible cons - if any or all of them apply, consider shifting to a server based solution:
In short, client-side Javascript is a perfectly viable platform for algorithmic computing, and can easily be deployed both to a browser and as a standalone app (using a browser engine like Awesomium), but it does have its caveats. Go over them to make an informed choice.